mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-23 14:25:07 +00:00
Add function entry count metadata.
Summary: This adds three Function methods to handle function entry counts: setEntryCount() and getEntryCount(). Entry counts are stored under the MD_prof metadata node with the name "function_entry_count". They are unsigned 64 bit values set by profilers (instrumentation and sample profiler changes coming up). Added documentation for new profile metadata and tests. Reviewers: dexonsmith, bogner Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D9628 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237260 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -19,6 +19,7 @@
|
||||
#define LLVM_IR_FUNCTION_H
|
||||
|
||||
#include "llvm/ADT/iterator_range.h"
|
||||
#include "llvm/ADT/Optional.h"
|
||||
#include "llvm/IR/Argument.h"
|
||||
#include "llvm/IR/Attributes.h"
|
||||
#include "llvm/IR/BasicBlock.h"
|
||||
@@ -194,6 +195,12 @@ public:
|
||||
AttributeSet::FunctionIndex, Kind, Value));
|
||||
}
|
||||
|
||||
/// Set the entry count for this function.
|
||||
void setEntryCount(uint64_t Count);
|
||||
|
||||
/// Get the entry count for this function.
|
||||
Optional<uint64_t> getEntryCount() const;
|
||||
|
||||
/// @brief Return true if the function has the attribute.
|
||||
bool hasFnAttribute(Attribute::AttrKind Kind) const {
|
||||
return AttributeSets.hasAttribute(AttributeSet::FunctionIndex, Kind);
|
||||
|
Reference in New Issue
Block a user