[llvm] [StructurizeCFG] Hoist and simplify zero-cost incoming else phi values (PR #139605)

Vigneshwar Jayakumar via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 23 21:18:39 PDT 2025


================
@@ -535,7 +613,7 @@ void StructurizeCFG::gatherPredicates(RegionNode *N) {
             BasicBlock *Other = Term->getSuccessor(!i);
             if (Visited.count(Other) && !Loops.count(Other) &&
                 !Pred.count(Other) && !Pred.count(P)) {
-
+              hoistZeroCostElseBlockPhiValues(Succ, Other);
----------------
VigneshwarJ wrote:

Added hoisting logic here, because the else block for structurized CFG is getting defined here. And there's no point in hoisting then block zero-cost instruction phis.

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


More information about the llvm-commits mailing list