[llvm] [EarlyIfConversion] Add cascading conditional branches as a conversion pattern (PR #218415)

Jonathan Cohen via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 24 23:49:58 PDT 2026


================
@@ -65,6 +70,16 @@ static cl::opt<bool> EnableDataDependentBranchAnalysis(
     "enable-early-ifcvt-data-dependent", cl::Hidden, cl::init(false),
     cl::desc("Enable hard-to-predict branch analysis for if-conversion"));
 
+// Enable recognition of cascade if-else patterns (chains of triangles).
+static cl::opt<bool> EnableCascadeIfConv(
+    "enable-early-ifcvt-cascade", cl::Hidden, cl::init(false),
+    cl::desc("Enable recognition of cascade if-else patterns"));
----------------
jcohen-apple wrote:

I would like to leave the option to enable / disable this patch without reverting all the code changes. I would like to first have the changes reviewed and merged, then enable them in a separate commit. 

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


More information about the llvm-commits mailing list