In the current main branch, all cold loops will not be applied non-trivial unswitch. As reported in D129599, skipping these cold loops will incur regression in SPEC benchmark.
Thus, instead of skipping cold loops, now only skipping loops in cold functions.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
@alexgatea Would you please also evaluate this patch on SPEC to see whether there are other regressions? Thanks
I don't think we need to worry about SPEC too much, just resolve regressions
llvm/test/Transforms/SimpleLoopUnswitch/PGO-nontrivial-unswitch2.ll | ||
---|---|---|
72–73 | looks like some of these aren't used? I think running this through opt without any passes should remove unused unnamed metadata |
I agree. And anyway, there was only one performance degradation observed due to the original commit, and I verified that this patch fixes it, so it should be all good.
This patch is provoking some extreme compile time when we have a large cold function with many loop nests, since it repeatedly reanalyzes the coldness of the entire function, which involves walking all BBs (and all instructions in the case of SamplePGO). Based on the example given in D129599 for the SPEC degradation, we should only need to check all loops in the loop nest, not the entire function. I mailed D146383 with that fix.
looks like some of these aren't used? I think running this through opt without any passes should remove unused unnamed metadata