summaryrefslogtreecommitdiff
path: root/include/llvm/IR/Function.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/llvm/IR/Function.h')
-rw-r--r--include/llvm/IR/Function.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/llvm/IR/Function.h b/include/llvm/IR/Function.h
index e811ae5e215a..79c56abe1c37 100644
--- a/include/llvm/IR/Function.h
+++ b/include/llvm/IR/Function.h
@@ -248,6 +248,12 @@ public:
/// pgo data.
Optional<uint64_t> getEntryCount() const;
+ /// Return true if the function is annotated with profile data.
+ ///
+ /// Presence of entry counts from a profile run implies the function has
+ /// profile annotations.
+ bool hasProfileData() const { return getEntryCount().hasValue(); }
+
/// Returns the set of GUIDs that needs to be imported to the function for
/// sample PGO, to enable the same inlines as the profiled optimized binary.
DenseSet<GlobalValue::GUID> getImportGUIDs() const;