[llvm] 6722352 - [SimpleLoopUnswitch] Re-enable simple-loop-unswitch-inject-invariant-conditions

Max Kazantsev via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 14 05:02:35 PST 2023


Author: Max Kazantsev
Date: 2023-02-14T19:54:19+07:00
New Revision: 67223522355b5d75ef4efc2889722239c44fc255

URL: https://github.com/llvm/llvm-project/commit/67223522355b5d75ef4efc2889722239c44fc255
DIFF: https://github.com/llvm/llvm-project/commit/67223522355b5d75ef4efc2889722239c44fc255.diff

LOG: [SimpleLoopUnswitch] Re-enable simple-loop-unswitch-inject-invariant-conditions

Underlying bug (taking a branch from inner loop as candidate) is now fixed.
We can return it.

Added: 
    

Modified: 
    llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp b/llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp
index 9304d16f2213..0cba37ddc2a2 100644
--- a/llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp
+++ b/llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp
@@ -125,7 +125,7 @@ static cl::opt<bool> InjectInvariantConditions(
     "simple-loop-unswitch-inject-invariant-conditions", cl::Hidden,
     cl::desc("Whether we should inject new invariants and unswitch them to "
              "eliminate some existing (non-invariant) conditions."),
-    cl::init(false));
+    cl::init(true));
 
 static cl::opt<unsigned> InjectInvariantConditionHotnesThreshold(
     "simple-loop-unswitch-inject-invariant-condition-hotness-threshold",


        


More information about the llvm-commits mailing list