Inliner needs ACT when calling InlineFunction. Instead of nullptr, we need to pass it in from SampleProfileLoader
Details
Diff Detail
Event Timeline
lib/Transforms/IPO/SampleProfile.cpp | ||
---|---|---|
1282 | add a FIXME comment for new pm here. |
Is the testing just testing opt not crashing?
Please cleanup the test case: shorten the names, and minimizes the number of debug info needed.
test/Transforms/SampleProfile/inline-act.ll | ||
---|---|---|
4 | empt --> empty |
It looks like the key parts of this test case are: a load/store to a global, an inline candidate with a switch in it, and debug information.
Are there any elements there that are unnecessary, or that could be trimmed down further? I'm asking because I'm not very familiar with the SampleProf code, and am having a hard time working out exactly how inline-act.ll works. It would help to have SampleProfileLoader dump some debug output that can be FileChecked.
This test is just testing if SampleLoader will crash under certain conditions. You are right, the crash will only happen when 3 of these conditions satisfy. It's more like a robustness test, so FileCheck may not be an option here.
IT looks like this use of IFI is at the InlineFunction method where a phi node is inserted when the callee has multiple exits and the result of the call is used. I think the test case can be simplified without needing to have any debug information. Alternatively, there are other places where IFI is used without any guards - for example when there is a pointer parameter with a specified alignment.
lgtm
Easwaran, can you help investigate the inliner to see if there is anything general to be done there -- either tighten the interface if ACT is always required or something else.
add a FIXME comment for new pm here.