We need to clean up CFG before assigning discriminator to minimize the impact of optimization on debug info.
Details
Diff Detail
Event Timeline
"minimize the impact of optimization on debug info." - what sort of impact are you referring to?
SampleProfile profile is collected on optimized binary. So at profile annotation step, it's better to have an IR resemble the optimized binary structure. Discriminator is the key to represent the profile, and SimplefyCFG is one major optimization that would change CFG. So if we move discriminator assignment after simplycfg, then at profile used at annotation would be more likely to resemble the optimized binary that is used for profiling.
Would it be possible to get a test case where we miss discriminator placement if simplifycfg doesn't run beforehand?
This patch works the other way: it reduces # of discriminators
assigned because CFGs are simplified. I don't think we can build such
a testcase unless simplifycfg complicates the CFG.
Thanks,
Dehao
The patch has been reverted because it breaks 96 clang tests (I only
do "make check" before committing).
The problem is that this will add a simplify-cfg pass to each clang
invocation as soon as add-discriminator pass is needed (even at -O0).
This will change the output of many clang tests.
Any suggestions what I should do here?
Thanks,
Dehao