diff --git a/src/coreclr/tools/aot/ILCompiler.Reflection.ReadyToRun/ReadyToRunReader.cs b/src/coreclr/tools/aot/ILCompiler.Reflection.ReadyToRun/ReadyToRunReader.cs index 4eab54b43b8628..c732d55ef2546a 100644 --- a/src/coreclr/tools/aot/ILCompiler.Reflection.ReadyToRun/ReadyToRunReader.cs +++ b/src/coreclr/tools/aot/ILCompiler.Reflection.ReadyToRun/ReadyToRunReader.cs @@ -1072,7 +1072,12 @@ private void ParsePgoMethods() PgoInfoKey key = new PgoInfoKey(mdReader, owningType, methodHandle, methodTypeArgs); PgoInfo info = new PgoInfo(key, this, pgoFormatVersion, Image, pgoOffset); - _pgoInfos.Add(key, info); + + // Since we do non-assembly qualified name based matching for generic instantiations, we can have conflicts. + // This is rare, so the current strategy is to just ignore them. This will allow the tooling to work, although + // the text output for PGO will be slightly wrong. + if (!_pgoInfos.ContainsKey(key)) + _pgoInfos.Add(key, info); curParser = allEntriesEnum.GetNext(); }