@@ -190,37 +190,38 @@ class VPBuilder {
190
190
new VPInstruction (Opcode, Operands, WrapFlags, DL, Name));
191
191
}
192
192
193
- VPValue *createNot (VPValue *Operand, DebugLoc DL = DebugLoc::getUnknown(),
194
- const Twine &Name = "") {
193
+ VPInstruction *createNot (VPValue *Operand,
194
+ DebugLoc DL = DebugLoc::getUnknown(),
195
+ const Twine &Name = "") {
195
196
return createInstruction (VPInstruction::Not, {Operand}, DL, Name);
196
197
}
197
198
198
- VPValue *createAnd (VPValue *LHS, VPValue *RHS,
199
- DebugLoc DL = DebugLoc::getUnknown(),
200
- const Twine &Name = "") {
199
+ VPInstruction *createAnd (VPValue *LHS, VPValue *RHS,
200
+ DebugLoc DL = DebugLoc::getUnknown(),
201
+ const Twine &Name = "") {
201
202
return createInstruction (Instruction::BinaryOps::And, {LHS, RHS}, DL, Name);
202
203
}
203
204
204
- VPValue *createOr (VPValue *LHS, VPValue *RHS,
205
- DebugLoc DL = DebugLoc::getUnknown(),
206
- const Twine &Name = "") {
205
+ VPInstruction *createOr (VPValue *LHS, VPValue *RHS,
206
+ DebugLoc DL = DebugLoc::getUnknown(),
207
+ const Twine &Name = "") {
207
208
208
209
return tryInsertInstruction (new VPInstruction (
209
210
Instruction::BinaryOps::Or, {LHS, RHS},
210
211
VPRecipeWithIRFlags::DisjointFlagsTy (false ), DL, Name));
211
212
}
212
213
213
- VPValue *createLogicalAnd (VPValue *LHS, VPValue *RHS,
214
- DebugLoc DL = DebugLoc::getUnknown(),
215
- const Twine &Name = "") {
214
+ VPInstruction *createLogicalAnd (VPValue *LHS, VPValue *RHS,
215
+ DebugLoc DL = DebugLoc::getUnknown(),
216
+ const Twine &Name = "") {
216
217
return tryInsertInstruction (
217
218
new VPInstruction (VPInstruction::LogicalAnd, {LHS, RHS}, DL, Name));
218
219
}
219
220
220
- VPValue * createSelect (VPValue *Cond, VPValue *TrueVal, VPValue *FalseVal,
221
- DebugLoc DL = DebugLoc::getUnknown() ,
222
- const Twine &Name = "",
223
- std::optional<FastMathFlags> FMFs = std::nullopt) {
221
+ VPInstruction *
222
+ createSelect (VPValue *Cond, VPValue *TrueVal, VPValue *FalseVal ,
223
+ DebugLoc DL = DebugLoc::getUnknown(), const Twine &Name = "",
224
+ std::optional<FastMathFlags> FMFs = std::nullopt) {
224
225
auto *Select =
225
226
FMFs ? new VPInstruction (Instruction::Select, {Cond, TrueVal, FalseVal},
226
227
*FMFs, DL, Name)
@@ -232,9 +233,9 @@ class VPBuilder {
232
233
// / Create a new ICmp VPInstruction with predicate \p Pred and operands \p A
233
234
// / and \p B.
234
235
// / TODO: add createFCmp when needed.
235
- VPValue *createICmp (CmpInst::Predicate Pred, VPValue *A, VPValue *B,
236
- DebugLoc DL = DebugLoc::getUnknown(),
237
- const Twine &Name = "") {
236
+ VPInstruction *createICmp (CmpInst::Predicate Pred, VPValue *A, VPValue *B,
237
+ DebugLoc DL = DebugLoc::getUnknown(),
238
+ const Twine &Name = "") {
238
239
assert (Pred >= CmpInst::FIRST_ICMP_PREDICATE &&
239
240
Pred <= CmpInst::LAST_ICMP_PREDICATE && " invalid predicate" );
240
241
return tryInsertInstruction (
@@ -248,16 +249,16 @@ class VPBuilder {
248
249
new VPInstruction (VPInstruction::PtrAdd, {Ptr, Offset},
249
250
GEPNoWrapFlags::none (), DL, Name));
250
251
}
251
- VPValue *createInBoundsPtrAdd (VPValue *Ptr, VPValue *Offset,
252
- DebugLoc DL = DebugLoc::getUnknown(),
253
- const Twine &Name = "") {
252
+ VPInstruction *createInBoundsPtrAdd (VPValue *Ptr, VPValue *Offset,
253
+ DebugLoc DL = DebugLoc::getUnknown(),
254
+ const Twine &Name = "") {
254
255
return tryInsertInstruction (
255
256
new VPInstruction (VPInstruction::PtrAdd, {Ptr, Offset},
256
257
GEPNoWrapFlags::inBounds (), DL, Name));
257
258
}
258
259
259
- VPInstruction *createScalarPhi (ArrayRef<VPValue *> IncomingValues,
260
- DebugLoc DL, const Twine &Name = " " ) {
260
+ VPPhi *createScalarPhi (ArrayRef<VPValue *> IncomingValues, DebugLoc DL ,
261
+ const Twine &Name = " " ) {
261
262
return tryInsertInstruction (new VPPhi (IncomingValues, DL, Name));
262
263
}
263
264
0 commit comments