================
@@ -558,8 +513,9 @@ Error InstrProfSymtab::addVTableWithName(GlobalVariable
&VTable,
return E;
bool Inserted = true;
- std::tie(std::ignore, Inserted) = MD5VTableMap.try_emplace(
- GlobalValue::getGUIDAssumingExternalLinkage(Name), &VTable);
+ uint64_t GUID = VTable.getGUIDIfAssigned().value_or(
----------------
orodley wrote:
I looked at this and the behaviour was actually incorrect. Both
`addFuncWithName` and `addVTableWithName` get called multiple times for the
same object, once for each name it should be findable by (the deprecated PGO
name, the canonical name, etc.). Using the assigned GUID when present put every
one of those entries under the same key, so once an object had a GUID it could
only be found by that GUID, and lookups by any of its names failed.
Fixed to always hash the given name, and add the assigned GUID as one extra
key. That removes this pattern, so I don't think a method is needed. Added
tests for both cases.
https://github.com/llvm/llvm-project/pull/214134
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits