Skip to content

Commit 1a0bae5

Browse files
committed
Make having flags (FMFs etc) not require inheriting VPSingleDefRecipe
In the next patch `VPWidenCallRecipe` is made to return multiple results. It still needs to support flags, but can't be a `VPSingleDefRecipe`. This is fixed by replacing `VPRecipeWithIRFlags` with `VPRecipeIRFlags`, and adding the virtual method `VPRecipeIRFlags* VPRecipeBase::getIRFlags()`. So now a recipe having flags does not require any special inheritance (or imply a number of results).
1 parent d2643e2 commit 1a0bae5

File tree

5 files changed

+162
-134
lines changed

5 files changed

+162
-134
lines changed

llvm/lib/Transforms/Vectorize/LoopVectorizationPlanner.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ class VPBuilder {
168168

169169
VPInstruction *createOverflowingOp(unsigned Opcode,
170170
std::initializer_list<VPValue *> Operands,
171-
VPRecipeWithIRFlags::WrapFlagsTy WrapFlags,
171+
VPRecipeIRFlags::WrapFlagsTy WrapFlags,
172172
DebugLoc DL = {}, const Twine &Name = "") {
173173
return tryInsertInstruction(
174174
new VPInstruction(Opcode, Operands, WrapFlags, DL, Name));
@@ -187,9 +187,9 @@ class VPBuilder {
187187
VPValue *createOr(VPValue *LHS, VPValue *RHS, DebugLoc DL = {},
188188
const Twine &Name = "") {
189189

190-
return tryInsertInstruction(new VPInstruction(
191-
Instruction::BinaryOps::Or, {LHS, RHS},
192-
VPRecipeWithIRFlags::DisjointFlagsTy(false), DL, Name));
190+
return tryInsertInstruction(
191+
new VPInstruction(Instruction::BinaryOps::Or, {LHS, RHS},
192+
VPRecipeIRFlags::DisjointFlagsTy(false), DL, Name));
193193
}
194194

195195
VPValue *createLogicalAnd(VPValue *LHS, VPValue *RHS, DebugLoc DL = {},
@@ -223,12 +223,12 @@ class VPBuilder {
223223
VPInstruction *createPtrAdd(VPValue *Ptr, VPValue *Offset, DebugLoc DL = {},
224224
const Twine &Name = "") {
225225
return tryInsertInstruction(new VPInstruction(
226-
Ptr, Offset, VPRecipeWithIRFlags::GEPFlagsTy(false), DL, Name));
226+
Ptr, Offset, VPRecipeIRFlags::GEPFlagsTy(false), DL, Name));
227227
}
228228
VPValue *createInBoundsPtrAdd(VPValue *Ptr, VPValue *Offset, DebugLoc DL = {},
229229
const Twine &Name = "") {
230230
return tryInsertInstruction(new VPInstruction(
231-
Ptr, Offset, VPRecipeWithIRFlags::GEPFlagsTy(true), DL, Name));
231+
Ptr, Offset, VPRecipeIRFlags::GEPFlagsTy(true), DL, Name));
232232
}
233233

234234
VPDerivedIVRecipe *createDerivedIV(InductionDescriptor::InductionKind Kind,

0 commit comments

Comments
 (0)