Skip to content

Commit e7547fc

Browse files
committed
VPlan/Builder: refine return types (NFC)
1 parent ba57ff6 commit e7547fc

File tree

1 file changed

+19
-17
lines changed

1 file changed

+19
-17
lines changed

llvm/lib/Transforms/Vectorize/LoopVectorizationPlanner.h

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -187,33 +187,34 @@ class VPBuilder {
187187
new VPInstruction(Opcode, Operands, WrapFlags, DL, Name));
188188
}
189189

190-
VPValue *createNot(VPValue *Operand, DebugLoc DL = {},
191-
const Twine &Name = "") {
190+
VPInstruction *createNot(VPValue *Operand, DebugLoc DL = {},
191+
const Twine &Name = "") {
192192
return createInstruction(VPInstruction::Not, {Operand}, DL, Name);
193193
}
194194

195-
VPValue *createAnd(VPValue *LHS, VPValue *RHS, DebugLoc DL = {},
196-
const Twine &Name = "") {
195+
VPInstruction *createAnd(VPValue *LHS, VPValue *RHS, DebugLoc DL = {},
196+
const Twine &Name = "") {
197197
return createInstruction(Instruction::BinaryOps::And, {LHS, RHS}, DL, Name);
198198
}
199199

200-
VPValue *createOr(VPValue *LHS, VPValue *RHS, DebugLoc DL = {},
201-
const Twine &Name = "") {
200+
VPInstruction *createOr(VPValue *LHS, VPValue *RHS, DebugLoc DL = {},
201+
const Twine &Name = "") {
202202

203203
return tryInsertInstruction(new VPInstruction(
204204
Instruction::BinaryOps::Or, {LHS, RHS},
205205
VPRecipeWithIRFlags::DisjointFlagsTy(false), DL, Name));
206206
}
207207

208-
VPValue *createLogicalAnd(VPValue *LHS, VPValue *RHS, DebugLoc DL = {},
209-
const Twine &Name = "") {
208+
VPInstruction *createLogicalAnd(VPValue *LHS, VPValue *RHS, DebugLoc DL = {},
209+
const Twine &Name = "") {
210210
return tryInsertInstruction(
211211
new VPInstruction(VPInstruction::LogicalAnd, {LHS, RHS}, DL, Name));
212212
}
213213

214-
VPValue *createSelect(VPValue *Cond, VPValue *TrueVal, VPValue *FalseVal,
215-
DebugLoc DL = {}, const Twine &Name = "",
216-
std::optional<FastMathFlags> FMFs = std::nullopt) {
214+
VPInstruction *
215+
createSelect(VPValue *Cond, VPValue *TrueVal, VPValue *FalseVal,
216+
DebugLoc DL = {}, const Twine &Name = "",
217+
std::optional<FastMathFlags> FMFs = std::nullopt) {
217218
auto *Select =
218219
FMFs ? new VPInstruction(Instruction::Select, {Cond, TrueVal, FalseVal},
219220
*FMFs, DL, Name)
@@ -225,8 +226,8 @@ class VPBuilder {
225226
/// Create a new ICmp VPInstruction with predicate \p Pred and operands \p A
226227
/// and \p B.
227228
/// TODO: add createFCmp when needed.
228-
VPValue *createICmp(CmpInst::Predicate Pred, VPValue *A, VPValue *B,
229-
DebugLoc DL = {}, const Twine &Name = "") {
229+
VPInstruction *createICmp(CmpInst::Predicate Pred, VPValue *A, VPValue *B,
230+
DebugLoc DL = {}, const Twine &Name = "") {
230231
assert(Pred >= CmpInst::FIRST_ICMP_PREDICATE &&
231232
Pred <= CmpInst::LAST_ICMP_PREDICATE && "invalid predicate");
232233
return tryInsertInstruction(
@@ -239,15 +240,16 @@ class VPBuilder {
239240
new VPInstruction(VPInstruction::PtrAdd, {Ptr, Offset},
240241
GEPNoWrapFlags::none(), DL, Name));
241242
}
242-
VPValue *createInBoundsPtrAdd(VPValue *Ptr, VPValue *Offset, DebugLoc DL = {},
243-
const Twine &Name = "") {
243+
VPInstruction *createInBoundsPtrAdd(VPValue *Ptr, VPValue *Offset,
244+
DebugLoc DL = {},
245+
const Twine &Name = "") {
244246
return tryInsertInstruction(
245247
new VPInstruction(VPInstruction::PtrAdd, {Ptr, Offset},
246248
GEPNoWrapFlags::inBounds(), DL, Name));
247249
}
248250

249-
VPInstruction *createScalarPhi(ArrayRef<VPValue *> IncomingValues,
250-
DebugLoc DL, const Twine &Name = "") {
251+
VPPhi *createScalarPhi(ArrayRef<VPValue *> IncomingValues, DebugLoc DL,
252+
const Twine &Name = "") {
251253
return tryInsertInstruction(new VPPhi(IncomingValues, DL, Name));
252254
}
253255

0 commit comments

Comments
 (0)