[llvm] [VPlan] Introduce ComputeReductionResult VPInstruction opcode. (PR #70253)

via llvm-commits llvm-commits at lists.llvm.org
Sun Dec 24 13:35:08 PST 2023


================
@@ -456,6 +456,7 @@ void VPBasicBlock::execute(VPTransformState *State) {
     // The Exit block of a loop is always set to be successor 0 of the Exiting
     // block.
     cast<BranchInst>(ExitingBB->getTerminator())->setSuccessor(0, NewBB);
+    State->Builder.SetInsertPoint(NewBB->getFirstNonPHI());
----------------
ayalz wrote:

 -- which highlights the fact that this patch is the first to introduce a recipe in the Middle block -- something worth noting in the summary, if not in the title...

nit: perhaps more consistent to set the insertion point earlier, next to setting CFG.PrevBB, as part of `// ExitBB can be re-used ...` (or rather it must be reused), rather than under the last `// Update the branch ...` part. Also, doing so aligns with the `else if` case below (although arguably setting the insertion point to `Terminator` is redundant after having set it to `NewBB` and created `Terminator`?)

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


More information about the llvm-commits mailing list