Update prebuilt Clang to r416183b from Android.
https://android.googlesource.com/platform/prebuilts/clang/host/
linux-x86/+/06a71ddac05c22edb2d10b590e1769b3f8619bef
clang 12.0.5 (based on r416183b) from build 7284624.
Change-Id: I277a316abcf47307562d8b748b84870f31a72866
Signed-off-by: Olivier Deprez <olivier.deprez@arm.com>
diff --git a/linux-x64/clang/include/llvm/ProfileData/InstrProfReader.h b/linux-x64/clang/include/llvm/ProfileData/InstrProfReader.h
index 73751fa..2c2cfb9 100644
--- a/linux-x64/clang/include/llvm/ProfileData/InstrProfReader.h
+++ b/linux-x64/clang/include/llvm/ProfileData/InstrProfReader.h
@@ -50,8 +50,12 @@
InstrProfIterator(InstrProfReader *Reader) : Reader(Reader) { Increment(); }
InstrProfIterator &operator++() { Increment(); return *this; }
- bool operator==(const InstrProfIterator &RHS) { return Reader == RHS.Reader; }
- bool operator!=(const InstrProfIterator &RHS) { return Reader != RHS.Reader; }
+ bool operator==(const InstrProfIterator &RHS) const {
+ return Reader == RHS.Reader;
+ }
+ bool operator!=(const InstrProfIterator &RHS) const {
+ return Reader != RHS.Reader;
+ }
value_type &operator*() { return Record; }
value_type *operator->() { return &Record; }
};
@@ -79,6 +83,8 @@
virtual bool hasCSIRLevelProfile() const = 0;
+ virtual bool instrEntryBBEnabled() const = 0;
+
/// Return the PGO symtab. There are three different readers:
/// Raw, Text, and Indexed profile readers. The first two types
/// of readers are used only by llvm-profdata tool, while the indexed
@@ -92,7 +98,7 @@
virtual InstrProfSymtab &getSymtab() = 0;
/// Compute the sum of counts and return in Sum.
- void accumuateCounts(CountSumOrPercent &Sum, bool IsCS);
+ void accumulateCounts(CountSumOrPercent &Sum, bool IsCS);
protected:
std::unique_ptr<InstrProfSymtab> Symtab;
@@ -148,6 +154,7 @@
line_iterator Line;
bool IsIRLevelProfile = false;
bool HasCSIRLevelProfile = false;
+ bool InstrEntryBBEnabled = false;
Error readValueProfileData(InstrProfRecord &Record);
@@ -164,6 +171,8 @@
bool hasCSIRLevelProfile() const override { return HasCSIRLevelProfile; }
+ bool instrEntryBBEnabled() const override { return InstrEntryBBEnabled; }
+
/// Read the header.
Error readHeader() override;
@@ -224,6 +233,10 @@
return (Version & VARIANT_MASK_CSIR_PROF) != 0;
}
+ bool instrEntryBBEnabled() const override {
+ return (Version & VARIANT_MASK_INSTR_ENTRY) != 0;
+ }
+
InstrProfSymtab &getSymtab() override {
assert(Symtab.get());
return *Symtab.get();
@@ -268,8 +281,14 @@
return (const char *)ValueDataStart;
}
- const uint64_t *getCounter(IntPtrT CounterPtr) const {
- ptrdiff_t Offset = (swap(CounterPtr) - CountersDelta) / sizeof(uint64_t);
+ /// Get the offset of \p CounterPtr from the start of the counters section of
+ /// the profile. The offset has units of "number of counters", i.e. increasing
+ /// the offset by 1 corresponds to an increase in the *byte offset* by 8.
+ ptrdiff_t getCounterOffset(IntPtrT CounterPtr) const {
+ return (swap(CounterPtr) - CountersDelta) / sizeof(uint64_t);
+ }
+
+ const uint64_t *getCounter(ptrdiff_t Offset) const {
return CountersStart + Offset;
}
@@ -354,6 +373,7 @@
virtual uint64_t getVersion() const = 0;
virtual bool isIRLevelProfile() const = 0;
virtual bool hasCSIRLevelProfile() const = 0;
+ virtual bool instrEntryBBEnabled() const = 0;
virtual Error populateSymtab(InstrProfSymtab &) = 0;
};
@@ -402,6 +422,10 @@
return (FormatVersion & VARIANT_MASK_CSIR_PROF) != 0;
}
+ bool instrEntryBBEnabled() const override {
+ return (FormatVersion & VARIANT_MASK_INSTR_ENTRY) != 0;
+ }
+
Error populateSymtab(InstrProfSymtab &Symtab) override {
return Symtab.create(HashTable->keys());
}
@@ -456,6 +480,10 @@
return Index->hasCSIRLevelProfile();
}
+ bool instrEntryBBEnabled() const override {
+ return Index->instrEntryBBEnabled();
+ }
+
/// Return true if the given buffer is in an indexed instrprof format.
static bool hasFormat(const MemoryBuffer &DataBuffer);