Skip to content

Commit b4f91b0

Browse files
committed
[LV] Use IRBuilder::insert to insert VPWidenRecipe (NFC).
1 parent 6273877 commit b4f91b0

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

llvm/lib/Transforms/Vectorize/LoopVectorize.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8937,15 +8937,12 @@ VPRecipeBuilder::tryToCreatePartialReduction(Instruction *Reduction,
89378937

89388938
unsigned ReductionOpcode = Reduction->getOpcode();
89398939
if (ReductionOpcode == Instruction::Sub) {
8940-
VPBasicBlock *ParentBlock = Builder.getInsertBlock();
8941-
assert(ParentBlock && "Builder must have an insert block.");
8942-
89438940
auto *const Zero = ConstantInt::get(Reduction->getType(), 0);
89448941
SmallVector<VPValue *, 2> Ops;
89458942
Ops.push_back(Plan.getOrAddLiveIn(Zero));
89468943
Ops.push_back(BinOp);
89478944
BinOp = new VPWidenRecipe(*Reduction, make_range(Ops.begin(), Ops.end()));
8948-
ParentBlock->appendRecipe(BinOp->getDefiningRecipe());
8945+
Builder.insert(BinOp->getDefiningRecipe());
89498946
ReductionOpcode = Instruction::Add;
89508947
}
89518948

0 commit comments

Comments
 (0)