[llvm-branch-commits] [llvm] 3900f3f - Pin -loop-reduce to legacy PM

Arthur Eubanks via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Tue Dec 8 13:53:13 PST 2020


Author: Arthur Eubanks
Date: 2020-12-08T13:48:23-08:00
New Revision: 3900f3f18c610092bb05292fcce76af2e9ae6c53

URL: https://github.com/llvm/llvm-project/commit/3900f3f18c610092bb05292fcce76af2e9ae6c53
DIFF: https://github.com/llvm/llvm-project/commit/3900f3f18c610092bb05292fcce76af2e9ae6c53.diff

LOG: Pin -loop-reduce to legacy PM

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

Added: 
    

Modified: 
    llvm/tools/opt/opt.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/tools/opt/opt.cpp b/llvm/tools/opt/opt.cpp
index 5e641783e274..36b82b2bcc37 100644
--- a/llvm/tools/opt/opt.cpp
+++ b/llvm/tools/opt/opt.cpp
@@ -477,7 +477,8 @@ static bool shouldPinPassToLegacyPM(StringRef Pass) {
       "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;


        


More information about the llvm-branch-commits mailing list