[llvm] [VPlan] Introduce scalar loop header in plan, remove VPLiveOut. (PR #109975)

via llvm-commits llvm-commits at lists.llvm.org
Sun Oct 27 14:41:45 PDT 2024


================
@@ -455,8 +455,12 @@ void VPIRBasicBlock::execute(VPTransformState *State) {
          "VPIRBasicBlock can have at most two successors at the moment!");
   State->Builder.SetInsertPoint(IRBB->getTerminator());
   executeRecipes(State, IRBB);
-  if (getSingleSuccessor()) {
-    assert(isa<UnreachableInst>(IRBB->getTerminator()));
+  // Prepare branch instruction in IRBB. If there are no successors, there's
+  // nothing to do. If IRBB's terminator is already a BranchInst, there's
+  // nothing to do here. If it is unreachable, we don't cannot re-use an
+  // existing branch and no branch has been created during recipe execution.
+  // Create it now.
----------------
ayalz wrote:

```suggestion
  //  Create a branch instruction to terminate IRBB if one was not created yet and needed.
```


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


More information about the llvm-commits mailing list