[llvm] [SimpleLoopUnswitch] Record loops from unswitching non-trivial conditions (PR #141121)

Yingwei Zheng via llvm-commits llvm-commits at lists.llvm.org
Fri May 30 07:03:30 PDT 2025


================
@@ -88,7 +88,7 @@ static cl::opt<bool> EnableNonTrivialUnswitch(
              "following the configuration passed into the pass."));
 
 static cl::opt<int>
-    UnswitchThreshold("unswitch-threshold", cl::init(50), cl::Hidden,
+    UnswitchThreshold("unswitch-threshold", cl::init(120), cl::Hidden,
----------------
dtcxzyw wrote:

> While this should optimistically suffice, ensure the outer loop basic block size is taken into account as well when estimating the cost for unswitching non-trivial conditions.

Can you provide some performance data on SPEC/llvm-test-suite? IMO adding `llvm.loop.unswitch.nontrivial.disable` is enough...


https://github.com/llvm/llvm-project/pull/141121


More information about the llvm-commits mailing list