Skip to content

Commit f8fa931

Browse files
committed
[LV] Add VPBuilder::insert, use to insert created vector pointer (NFC).
Split off from #124432 as suggested. Adds VPBuilder::insert, inspired by IRBuilderBase.
1 parent a284a6e commit f8fa931

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

llvm/lib/Transforms/Vectorize/LoopVectorizationPlanner.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,9 @@ class VPBuilder {
141141
InsertPt = IP->getIterator();
142142
}
143143

144+
/// Insert \p R at the current insertion point.
145+
void insert(VPRecipeBase *R) { BB->insert(R, InsertPt); }
146+
144147
/// Create an N-ary operation with \p Opcode, \p Operands and set \p Inst as
145148
/// its underlying Instruction.
146149
VPInstruction *createNaryOp(unsigned Opcode, ArrayRef<VPValue *> Operands,

llvm/lib/Transforms/Vectorize/LoopVectorize.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8323,7 +8323,7 @@ VPRecipeBuilder::tryToWidenMemory(Instruction *I, ArrayRef<VPValue *> Operands,
83238323
: GEPNoWrapFlags::none(),
83248324
I->getDebugLoc());
83258325
}
8326-
Builder.getInsertBlock()->appendRecipe(VectorPtr);
8326+
Builder.insert(VectorPtr);
83278327
Ptr = VectorPtr;
83288328
}
83298329
if (LoadInst *Load = dyn_cast<LoadInst>(I))

0 commit comments

Comments
 (0)