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

via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 30 13:51:36 PDT 2024


================
@@ -455,8 +455,9 @@ 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()));
+  // Create a branch instruction to terminate IRBB if one was not created yet
+  // and is needed.
----------------
ayalz wrote:

Perhaps worth asserting that if there are two successors (or more than one, asserted above to be <= 2), terminator isn't `UnreachableInst`:
`assert((getHierarchicalSuccessors().size() < 2 || !isa<UnreachableInst>(IRBB->getTerminator())) && "Block with multiple successors ends with UnreachableInst");`

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


More information about the llvm-commits mailing list