[PATCH] D92796: Pin -loop-reduce to legacy PM

Arthur Eubanks via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 7 15:40:13 PST 2020


aeubanks created this revision.
aeubanks added reviewers: rnk, ychen, asbirlea.
Herald added subscribers: pengfei, javed.absar, george.burgess.iv.
aeubanks requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D92796

Files:
  llvm/tools/opt/opt.cpp


Index: llvm/tools/opt/opt.cpp
===================================================================
--- llvm/tools/opt/opt.cpp
+++ llvm/tools/opt/opt.cpp
@@ -476,7 +476,8 @@
       "mve-tail-predication", "interleaved-access",
       "global-merge",         "pre-isel-intrinsic-lowering",
       "expand-reductions",    "indirectbr-expand",
-      "generic-to-nvvm",      "expandmemcmp"};
+      "generic-to-nvvm",      "expandmemcmp",
+      "loop-reduce"};
   for (const auto &P : PassNamePrefix)
     if (Pass.startswith(P))
       return true;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D92796.310043.patch
Type: text/x-patch
Size: 546 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201207/5388dca0/attachment.bin>


More information about the llvm-commits mailing list