In the ThinLTO compilation, if a function is inlined in the profiling binary, we need to inline it before annotation. If the callee is not available in the primary module, a first step is needed to import that callee function. For the current implementation, if the call is an indirect call, which has been promoted to >1 targets and inlined, SamplePGO will only import one target with the largest sample count. This patch fixed the bug to import all targets instead.
Details
Details
Diff Detail
Diff Detail
- Build Status
Buildable 9246 Build 9246: arc lint + arc unit
Event Timeline
lib/Transforms/IPO/SampleProfile.cpp | ||
---|---|---|
734 | I'm not really following the flow of what is supposed to happen here. I see that the earlier code already does an iteration over findIndirectCallFunctionSamples - can/should this be combined with that? | |
test/Transforms/SampleProfile/import.ll | ||
18 | Update comment (foo1 and foo2 also) |
lib/Transforms/IPO/SampleProfile.cpp | ||
---|---|---|
734 | I'm planning to do that in a separate patch, in which I'll also move the InlineFunction call inside the loop too. |
I'm not really following the flow of what is supposed to happen here. I see that the earlier code already does an iteration over findIndirectCallFunctionSamples - can/should this be combined with that?