@@ -79,6 +79,13 @@ class VPBuilder {
7979 VPBasicBlock *getInsertBlock () const { return BB; }
8080 VPBasicBlock::iterator getInsertPoint () const { return InsertPt; }
8181
82+ // / Create a VPBuilder to insert after \p R.
83+ static VPBuilder getToInsertAfter (VPRecipeBase *R) {
84+ VPBuilder B;
85+ B.setInsertPoint (R->getParent (), std::next (R->getIterator ()));
86+ return B;
87+ }
88+
8289 // / InsertPoint - A saved insertion point.
8390 class VPInsertPoint {
8491 VPBasicBlock *Block = nullptr ;
@@ -131,17 +138,18 @@ class VPBuilder {
131138
132139 // / Create an N-ary operation with \p Opcode, \p Operands and set \p Inst as
133140 // / its underlying Instruction.
134- VPValue *createNaryOp (unsigned Opcode, ArrayRef<VPValue *> Operands,
135- Instruction *Inst = nullptr , const Twine &Name = " " ) {
141+ VPInstruction *createNaryOp (unsigned Opcode, ArrayRef<VPValue *> Operands,
142+ Instruction *Inst = nullptr ,
143+ const Twine &Name = " " ) {
136144 DebugLoc DL;
137145 if (Inst)
138146 DL = Inst->getDebugLoc ();
139147 VPInstruction *NewVPInst = createInstruction (Opcode, Operands, DL, Name);
140148 NewVPInst->setUnderlyingValue (Inst);
141149 return NewVPInst;
142150 }
143- VPValue *createNaryOp (unsigned Opcode, ArrayRef<VPValue *> Operands,
144- DebugLoc DL, const Twine &Name = " " ) {
151+ VPInstruction *createNaryOp (unsigned Opcode, ArrayRef<VPValue *> Operands,
152+ DebugLoc DL, const Twine &Name = " " ) {
145153 return createInstruction (Opcode, Operands, DL, Name);
146154 }
147155
0 commit comments