================
@@ -490,6 +591,23 @@ Error InstrProfSymtab::addFuncWithName(Function &F, 
StringRef PGOFuncName) {
   return Error::success();
 }
 
+uint64_t InstrProfSymtab::getVTableHashFromAddress(uint64_t Address) {
+  finalizeSymtab();
+  auto It = lower_bound(
+      VTableAddrRangeToMD5Map, Address,
----------------
minglotus-6 wrote:

New test case added in `value_prof_data_read_write_mapping` (in 
InstrProfTest.cpp) catches a subtle bug by `VTableRangeAddr.first.second < 
Addr`. Already fixed by using `VTableRangeAddr.first.second <= Addr`. 

Basically, the profiled address from a vtable should be in the range 
[VTableStartAddr, VTableEndAddr). In the unit test, each vtable has one 
function (no offset-to-top, no RTTI). Using `<` would map profiled address to 
the wrong vtable.

https://github.com/llvm/llvm-project/pull/66825
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to