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

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Sun Oct 27 08:26:45 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());
----------------
fhahn wrote:

I think no such case exists at the moment, but I updated the code to directly check if the terminator is Unreachable. And just retain the existing branch otherwise.

Back-patching is updated to allow re-setting to the same IRBB if the existing branch is re-used.

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


More information about the llvm-commits mailing list