Skip to content

Commit 664b187

Browse files
committed
Reland Pin -loop-reduce to legacy PM
This was accidentally reverted by a later change. LSR currently only runs in the codegen pass manager. There are a couple issues with LSR and the NPM. 1) Lots of tests assume that LCSSA isn't run before LSR. This breaks a bunch of tests' expected output. This is fixable with some time put in. 2) LSR doesn't preserve LCSSA. See llvm/test/Analysis/MemorySSA/update-remove-deadblocks.ll. LSR's use of SCEVExpander is the only use of SCEVExpander where the PreserveLCSSA option is off. Turning it on causes some code sinking out of loops to fail due to SCEVExpander's inability to handle the newly created trivial PHI nodes in the broken critical edge (I was looking at llvm/test/Transforms/LoopStrengthReduce/X86/2011-11-29-postincphi.ll). I also tried simply just calling formLCSSA() at the end of LSR, but the extra PHI nodes cause regressions in codegen tests. We'll delay figuring these issues out until later. This causes the number of check-llvm failures with -enable-new-pm true by default to go from 60 to 29. Reviewed By: asbirlea Differential Revision: https://reviews.llvm.org/D92796
1 parent b4cbb87 commit 664b187

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

llvm/tools/opt/opt.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,8 @@ static bool shouldPinPassToLegacyPM(StringRef Pass) {
485485
"expand-reductions",
486486
"indirectbr-expand",
487487
"generic-to-nvvm",
488-
"expandmemcmp"};
488+
"expandmemcmp",
489+
"loop-reduce"};
489490
for (const auto &P : PassNamePrefix)
490491
if (Pass.startswith(P))
491492
return true;

0 commit comments

Comments
 (0)