Issue 104813
Summary [TypeProf][PGO]Duplicate VTableProfileInfo lead to assert hit when creating indexed profile
Labels new issue
Assignees
Reporter philippuk
    The bug is found when trying to collect the PGO profile for chromium with the flag _-enable-vtable-value-profiling._

`llvm-profdata: chromium/src/third_party/llvm/llvm/include/llvm/ADT/IntervalMap.h:638: unsigned int llvm::IntervalMapImpl::LeafNode<unsigned long, unsigned long, 8, llvm::IntervalMapHalfOpenInfo<unsigned long>>::insertFrom(unsigned int &, unsigned int, KeyT, KeyT, ValT) [KeyT = unsigned long, ValT = unsigned long, N = 8, Traits = llvm::IntervalMapHalfOpenInfo<unsigned long>]: Assertion (i == Size || Traits::stopLess(b, start(i))) && "Overlapping insert"' failed.`

Our investigation concludes that when if there is a strong vtable and weak vtable at the same time, the respective _VTableProfileInfo_ still exist in the ___llvm_prf_vtab_ section since it is marked linker retained and cannot be garbage collected. Therefore, the duplicate info is read by the profiler and lead to the assert hit with the overlapping vtable pointer.

Our temporary hack is to add an if statement to not marked it as linker retained if the global variable is _linkonce_odr_ in https://github.com/llvm/llvm-project/blob/0ee0857363aadf9ce0f403e7e0da10f0a9d94887/llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp#L1594-L1596
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to