[llvm] [VPlan] Replace VPRegionBlock with explicit CFG before execute (NFCI). (PR #117506)

via llvm-commits llvm-commits at lists.llvm.org
Wed May 14 04:37:53 PDT 2025


================
@@ -576,18 +576,17 @@ Value *VPInstruction::generate(VPTransformState &State) {
   case VPInstruction::BranchOnCond: {
     Value *Cond = State.get(getOperand(0), VPLane(0));
     // Replace the temporary unreachable terminator with a new conditional
-    // branch, hooking it up to backward destination for exiting blocks now and
-    // to forward destination(s) later when they are created.
+    // branch, hooking it up to backward destination (header) for latch blocks
+    // now, and to forward destination(s) later when they are created.
     BranchInst *CondBr =
         Builder.CreateCondBr(Cond, Builder.GetInsertBlock(), nullptr);
     CondBr->setSuccessor(0, nullptr);
----------------
ayalz wrote:

```suggestion
    // First successor is always forward.
    CondBr->setSuccessor(0, nullptr);
```

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


More information about the llvm-commits mailing list