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

via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 25 14:35:01 PDT 2024


================
@@ -456,10 +456,17 @@ void VPIRBasicBlock::execute(VPTransformState *State) {
   State->Builder.SetInsertPoint(getIRBasicBlock()->getTerminator());
   executeRecipes(State, getIRBasicBlock());
   if (getSingleSuccessor()) {
-    assert(isa<UnreachableInst>(getIRBasicBlock()->getTerminator()));
-    auto *Br = State->Builder.CreateBr(getIRBasicBlock());
-    Br->setOperand(0, nullptr);
-    getIRBasicBlock()->getTerminator()->eraseFromParent();
+    auto *SuccVPIRBB = dyn_cast<VPIRBasicBlock>(getSingleSuccessor());
+    if (SuccVPIRBB && SuccVPIRBB->getIRBasicBlock() ==
+                          getIRBasicBlock()->getSingleSuccessor()) {
+      cast<BranchInst>(getIRBasicBlock()->getTerminator())
----------------
ayalz wrote:

If two VPIRBB's are already connected, why disconnect them? When the successor executes it will hook itself up to the predecessor?

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


More information about the llvm-commits mailing list