[llvm] [polly] [SimpleLoopUnswitch] Generalize the notion of trivial unswitching (PR #193989)

Ehsan Amiri via llvm-commits llvm-commits at lists.llvm.org
Sat Jun 13 22:05:30 PDT 2026


================
@@ -591,6 +592,48 @@ static bool unswitchTrivialBranch(Loop &L, CondBrInst &BI, DominatorTree &DT,
     }
   }
 
+  std::optional<int> LatchIdx = std::nullopt;
+  if (FullUnswitch && L.getUniqueLatchExitBlock() != nullptr)
+    if (BI.getSuccessor(0) == L.getLoopLatch() &&
----------------
amehsan wrote:

reduced the number of calls to one for each of the functions.

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


More information about the llvm-commits mailing list