This fixes a series of mis-compiles by SimpleLoopUnswitch.
My measurements showed no performance regression with -O3 on AArch64
in SPEC2006, SPEC2017 and a set of internal benchmarks.
Fixes #50387, #50430
Depends on D124251.
Paths
| Differential D124252
[SimpleLoopUnswitch] Enable freezing of conditions by default. ClosedPublic Authored by fhahn on Apr 22 2022, 5:14 AM.
Details Summary This fixes a series of mis-compiles by SimpleLoopUnswitch. My measurements showed no performance regression with -O3 on AArch64 Fixes #50387, #50430 Depends on D124251.
Diff Detail
Event TimelineThis revision is now accepted and ready to land.Apr 22 2022, 5:33 AM Comment Actions A quick question: should LoopUnswitch.cpp be fixed as well? It seems the pass is not maintained though. Will SimpleLoopUnswitch supercede the LoopUnswitch pass? Comment Actions I believe LoopUnswitch is only used in the legacy PM, so we should probably just delete the pass. Comment Actions
Yes, the pass should effectively be dead code with the move to the new PM and I don't think we should spend any time on updating it. I'll put up a patch to remove it. Comment Actions It sounds great - then after the removal of the old pass I will make a patch that removes https://github.com/llvm/llvm-project/blob/main/llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp#L2508 as well. Comment Actions
Patch is available: D124376 This revision was landed with ongoing or failed builds.Apr 25 2022, 6:27 AM Closed by commit rG6a6cc5542b61: [SimpleLoopUnswitch] Enable freezing of conditions by default. (authored by fhahn). · Explain Why This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 424889 llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp
llvm/test/Transforms/SimpleLoopUnswitch/ARM/nontrivial-unswitch-cost.ll
llvm/test/Transforms/SimpleLoopUnswitch/guards.ll
llvm/test/Transforms/SimpleLoopUnswitch/implicit-null-checks.ll
llvm/test/Transforms/SimpleLoopUnswitch/nontrivial-unswitch-cost.ll
llvm/test/Transforms/SimpleLoopUnswitch/nontrivial-unswitch.ll
|