@@ -79,6 +79,13 @@ class VPBuilder {
79
79
VPBasicBlock *getInsertBlock () const { return BB; }
80
80
VPBasicBlock::iterator getInsertPoint () const { return InsertPt; }
81
81
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
+
82
89
// / InsertPoint - A saved insertion point.
83
90
class VPInsertPoint {
84
91
VPBasicBlock *Block = nullptr ;
@@ -131,17 +138,18 @@ class VPBuilder {
131
138
132
139
// / Create an N-ary operation with \p Opcode, \p Operands and set \p Inst as
133
140
// / 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 = " " ) {
136
144
DebugLoc DL;
137
145
if (Inst)
138
146
DL = Inst->getDebugLoc ();
139
147
VPInstruction *NewVPInst = createInstruction (Opcode, Operands, DL, Name);
140
148
NewVPInst->setUnderlyingValue (Inst);
141
149
return NewVPInst;
142
150
}
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 = " " ) {
145
153
return createInstruction (Opcode, Operands, DL, Name);
146
154
}
147
155
0 commit comments