[PATCH] D31952: Build SymbolMap in SampleProfileLoader to help matchin function names with suffix.

Dehao Chen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 17 14:54:10 PDT 2017


danielcdh added inline comments.


================
Comment at: lib/Transforms/IPO/SampleProfile.cpp:1439
+      if (!r.second)
+        SymbolMap.erase(r.first);
+    }
----------------
davidxl wrote:
> danielcdh wrote:
> > davidxl wrote:
> > > Why erasing the existing entry?
> > Updated the comment to explain why we remove the existing entry.
> but the new entry is not inserted either here. Should it just reset r.second = F? Also In presence of conflict, how do we know which one to pick?
When there is conflict, we shall set the corresponding symbolmap entry to nullptr to avoid promoting random target.
Updated the code and test.


https://reviews.llvm.org/D31952





More information about the llvm-commits mailing list