If there is suffix added in the function name (e.g. module hash added by thinLTO), we will not be able to find a match in profile as the suffix does not exist in profile. This patch build a map from function name to Function *. The map includes the entry for the stripped function name so that inlineHotFunctions can find the corresponding function to promote/inline.
Details
Diff Detail
- Build Status
Buildable 5463 Build 5463: arc lint + arc unit
Event Timeline
lib/Transforms/IPO/SampleProfile.cpp | ||
---|---|---|
1390 | Why erasing the existing entry? |
lib/Transforms/IPO/SampleProfile.cpp | ||
---|---|---|
1390 | Updated the comment to explain why we remove the existing entry. |
lib/Transforms/IPO/SampleProfile.cpp | ||
---|---|---|
1390 | 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? |
update
lib/Transforms/IPO/SampleProfile.cpp | ||
---|---|---|
1390 | When there is conflict, we shall set the corresponding symbolmap entry to nullptr to avoid promoting random target. |
ok. The original erase is fine (given the intention is to discard cases with conflicts).
lgtm
Why erasing the existing entry?