Skip to content

Commit 2befda2

Browse files
authored
[VPlan] Populate and use VPIRFlags from initial VPInstruction. (#168450)
Update VPlan to populate VPIRFlags during VPInstruction construction and use it when creating widened recipes, instead of constructing VPIRFlags from the underlying IR instruction each time. The VPRecipeWithIRFlags constructor taking an underlying instruction and setting the flags based on it has been removed. This centralizes initial VPIRFlags creation and ensures flags are consistently available throughout VPlan transformations and makes sure we don't accidentally re-add flags from the underlying instruction that already got dropped during transformations. Follow-up to llvm/llvm-project#167253, which did the same for VPIRMetadata. Should be NFC w.r.t. to the generated IR. PR: llvm/llvm-project#168450
1 parent 9a0fd22 commit 2befda2

File tree

10 files changed

+134
-120
lines changed

10 files changed

+134
-120
lines changed

llvm/lib/Transforms/Vectorize/LoopVectorizationPlanner.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,11 +152,12 @@ class VPBuilder {
152152
/// its underlying Instruction.
153153
VPInstruction *createNaryOp(unsigned Opcode, ArrayRef<VPValue *> Operands,
154154
Instruction *Inst = nullptr,
155+
const VPIRFlags &Flags = {},
155156
const VPIRMetadata &MD = {},
156157
DebugLoc DL = DebugLoc::getUnknown(),
157158
const Twine &Name = "") {
158159
VPInstruction *NewVPInst = tryInsertInstruction(
159-
new VPInstruction(Opcode, Operands, {}, MD, DL, Name));
160+
new VPInstruction(Opcode, Operands, Flags, MD, DL, Name));
160161
NewVPInst->setUnderlyingValue(Inst);
161162
return NewVPInst;
162163
}
@@ -329,7 +330,7 @@ class VPBuilder {
329330
else if (Opcode == Instruction::ZExt)
330331
Flags = VPIRFlags::NonNegFlagsTy(false);
331332
return tryInsertInstruction(
332-
new VPWidenCastRecipe(Opcode, Op, ResultTy, Flags));
333+
new VPWidenCastRecipe(Opcode, Op, ResultTy, nullptr, Flags));
333334
}
334335

335336
VPScalarIVStepsRecipe *

llvm/lib/Transforms/Vectorize/LoopVectorize.cpp

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7750,7 +7750,7 @@ VPSingleDefRecipe *VPRecipeBuilder::tryToWidenCall(VPInstruction *VPI,
77507750
},
77517751
Range);
77527752
if (ShouldUseVectorIntrinsic)
7753-
return new VPWidenIntrinsicRecipe(*CI, ID, Ops, CI->getType(), *VPI,
7753+
return new VPWidenIntrinsicRecipe(*CI, ID, Ops, CI->getType(), *VPI, *VPI,
77547754
VPI->getDebugLoc());
77557755

77567756
Function *Variant = nullptr;
@@ -7804,7 +7804,8 @@ VPSingleDefRecipe *VPRecipeBuilder::tryToWidenCall(VPInstruction *VPI,
78047804
}
78057805

78067806
Ops.push_back(VPI->getOperand(VPI->getNumOperands() - 1));
7807-
return new VPWidenCallRecipe(CI, Variant, Ops, VPI->getDebugLoc());
7807+
return new VPWidenCallRecipe(CI, Variant, Ops, *VPI, *VPI,
7808+
VPI->getDebugLoc());
78087809
}
78097810

78107811
return nullptr;
@@ -7842,7 +7843,7 @@ VPWidenRecipe *VPRecipeBuilder::tryToWiden(VPInstruction *VPI) {
78427843
auto *SafeRHS =
78437844
Builder.createSelect(Mask, Ops[1], One, VPI->getDebugLoc());
78447845
Ops[1] = SafeRHS;
7845-
return new VPWidenRecipe(*I, Ops, *VPI, VPI->getDebugLoc());
7846+
return new VPWidenRecipe(*I, Ops, *VPI, *VPI, VPI->getDebugLoc());
78467847
}
78477848
[[fallthrough]];
78487849
}
@@ -7888,15 +7889,15 @@ VPWidenRecipe *VPRecipeBuilder::tryToWiden(VPInstruction *VPI) {
78887889
// For other binops, the legacy cost model only checks the second operand.
78897890
NewOps[1] = GetConstantViaSCEV(NewOps[1]);
78907891
}
7891-
return new VPWidenRecipe(*I, NewOps, *VPI, VPI->getDebugLoc());
7892+
return new VPWidenRecipe(*I, NewOps, *VPI, *VPI, VPI->getDebugLoc());
78927893
}
78937894
case Instruction::ExtractValue: {
78947895
SmallVector<VPValue *> NewOps(VPI->operands());
78957896
auto *EVI = cast<ExtractValueInst>(I);
78967897
assert(EVI->getNumIndices() == 1 && "Expected one extractvalue index");
78977898
unsigned Idx = EVI->getIndices()[0];
78987899
NewOps.push_back(Plan.getConstantInt(32, Idx));
7899-
return new VPWidenRecipe(*I, NewOps, *VPI, VPI->getDebugLoc());
7900+
return new VPWidenRecipe(*I, NewOps, *VPI, *VPI, VPI->getDebugLoc());
79007901
}
79017902
};
79027903
}
@@ -7981,7 +7982,8 @@ VPReplicateRecipe *VPRecipeBuilder::handleReplication(VPInstruction *VPI,
79817982
(Range.Start.isScalable() && isa<IntrinsicInst>(I))) &&
79827983
"Should not predicate a uniform recipe");
79837984
auto *Recipe =
7984-
new VPReplicateRecipe(I, VPI->operands(), IsUniform, BlockInMask, *VPI);
7985+
new VPReplicateRecipe(I, VPI->operands(), IsUniform, BlockInMask, *VPI,
7986+
*VPI, VPI->getDebugLoc());
79857987
return Recipe;
79867988
}
79877989

@@ -8231,17 +8233,19 @@ VPRecipeBase *VPRecipeBuilder::tryToCreateWidenRecipe(VPSingleDefRecipe *R,
82318233
return nullptr;
82328234

82338235
if (VPI->getOpcode() == Instruction::GetElementPtr)
8234-
return new VPWidenGEPRecipe(cast<GetElementPtrInst>(Instr), R->operands());
8236+
return new VPWidenGEPRecipe(cast<GetElementPtrInst>(Instr), R->operands(),
8237+
*VPI, VPI->getDebugLoc());
82358238

82368239
if (VPI->getOpcode() == Instruction::Select)
8237-
return new VPWidenSelectRecipe(*cast<SelectInst>(Instr), R->operands(),
8238-
*VPI);
8240+
return new VPWidenSelectRecipe(cast<SelectInst>(Instr), R->operands(), *VPI,
8241+
*VPI, VPI->getDebugLoc());
82398242

82408243
if (Instruction::isCast(VPI->getOpcode())) {
8241-
auto *CastR = cast<VPInstructionWithType>(R);
82428244
auto *CI = cast<CastInst>(Instr);
8245+
auto *CastR = cast<VPInstructionWithType>(VPI);
82438246
return new VPWidenCastRecipe(CI->getOpcode(), VPI->getOperand(0),
8244-
CastR->getResultType(), *CI, *VPI);
8247+
CastR->getResultType(), CI, *VPI, *VPI,
8248+
VPI->getDebugLoc());
82458249
}
82468250

82478251
return tryToWiden(VPI);
@@ -8269,8 +8273,8 @@ VPRecipeBuilder::tryToCreatePartialReduction(VPInstruction *Reduction,
82698273
SmallVector<VPValue *, 2> Ops;
82708274
Ops.push_back(Plan.getOrAddLiveIn(Zero));
82718275
Ops.push_back(BinOp);
8272-
BinOp = new VPWidenRecipe(*ReductionI, Ops, VPIRMetadata(),
8273-
ReductionI->getDebugLoc());
8276+
BinOp = new VPWidenRecipe(*ReductionI, Ops, VPIRFlags(*ReductionI),
8277+
VPIRMetadata(), ReductionI->getDebugLoc());
82748278
Builder.insert(BinOp->getDefiningRecipe());
82758279
ReductionOpcode = Instruction::Add;
82768280
}
@@ -8454,9 +8458,10 @@ VPlanPtr LoopVectorizationPlanner::tryToBuildVPlanWithVPRecipes(
84548458
Legal->isInvariantAddressOfReduction(SI->getPointerOperand())) {
84558459
// Only create recipe for the final invariant store of the reduction.
84568460
if (Legal->isInvariantStoreOfReduction(SI)) {
8461+
auto *VPI = cast<VPInstruction>(SingleDef);
84578462
auto *Recipe = new VPReplicateRecipe(
8458-
SI, R.operands(), true /* IsUniform */, nullptr /*Mask*/,
8459-
*cast<VPInstruction>(SingleDef));
8463+
SI, R.operands(), true /* IsUniform */, nullptr /*Mask*/, *VPI,
8464+
*VPI, VPI->getDebugLoc());
84608465
Recipe->insertBefore(*MiddleVPBB, MBIP);
84618466
}
84628467
R.eraseFromParent();

llvm/lib/Transforms/Vectorize/VPlan.h

Lines changed: 46 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -882,14 +882,6 @@ class VPIRFlags {
882882
/// A pure-virtual common base class for recipes defining a single VPValue and
883883
/// using IR flags.
884884
struct VPRecipeWithIRFlags : public VPSingleDefRecipe, public VPIRFlags {
885-
VPRecipeWithIRFlags(const unsigned char SC, ArrayRef<VPValue *> Operands,
886-
DebugLoc DL = DebugLoc::getUnknown())
887-
: VPSingleDefRecipe(SC, Operands, DL), VPIRFlags() {}
888-
889-
VPRecipeWithIRFlags(const unsigned char SC, ArrayRef<VPValue *> Operands,
890-
Instruction &I)
891-
: VPSingleDefRecipe(SC, Operands, &I, I.getDebugLoc()), VPIRFlags(I) {}
892-
893885
VPRecipeWithIRFlags(const unsigned char SC, ArrayRef<VPValue *> Operands,
894886
const VPIRFlags &Flags,
895887
DebugLoc DL = DebugLoc::getUnknown())
@@ -1474,9 +1466,12 @@ class LLVM_ABI_FOR_TEST VPWidenRecipe : public VPRecipeWithIRFlags,
14741466
VPIRMetadata(Metadata), Opcode(Opcode) {}
14751467

14761468
VPWidenRecipe(Instruction &I, ArrayRef<VPValue *> Operands,
1477-
const VPIRMetadata &Metadata, DebugLoc DL)
1478-
: VPRecipeWithIRFlags(VPDef::VPWidenSC, Operands, I),
1479-
VPIRMetadata(Metadata), Opcode(I.getOpcode()) {}
1469+
const VPIRFlags &Flags = {}, const VPIRMetadata &Metadata = {},
1470+
DebugLoc DL = {})
1471+
: VPRecipeWithIRFlags(VPDef::VPWidenSC, Operands, Flags, DL),
1472+
VPIRMetadata(Metadata), Opcode(I.getOpcode()) {
1473+
setUnderlyingValue(&I);
1474+
}
14801475

14811476
~VPWidenRecipe() override = default;
14821477

@@ -1517,30 +1512,22 @@ class VPWidenCastRecipe : public VPRecipeWithIRFlags, public VPIRMetadata {
15171512

15181513
public:
15191514
VPWidenCastRecipe(Instruction::CastOps Opcode, VPValue *Op, Type *ResultTy,
1520-
CastInst &UI, const VPIRMetadata &Metadata)
1521-
: VPRecipeWithIRFlags(VPDef::VPWidenCastSC, Op, UI),
1522-
VPIRMetadata(Metadata), Opcode(Opcode), ResultTy(ResultTy) {
1523-
assert(UI.getOpcode() == Opcode &&
1524-
"opcode of underlying cast doesn't match");
1525-
}
1526-
VPWidenCastRecipe(Instruction::CastOps Opcode, VPValue *Op, Type *ResultTy,
1527-
const VPIRFlags &Flags = {},
1515+
CastInst *CI = nullptr, const VPIRFlags &Flags = {},
15281516
const VPIRMetadata &Metadata = {},
15291517
DebugLoc DL = DebugLoc::getUnknown())
15301518
: VPRecipeWithIRFlags(VPDef::VPWidenCastSC, Op, Flags, DL),
15311519
VPIRMetadata(Metadata), Opcode(Opcode), ResultTy(ResultTy) {
15321520
assert(flagsValidForOpcode(Opcode) &&
15331521
"Set flags not supported for the provided opcode");
1522+
setUnderlyingValue(CI);
15341523
}
15351524

15361525
~VPWidenCastRecipe() override = default;
15371526

15381527
VPWidenCastRecipe *clone() override {
1539-
auto *New = new VPWidenCastRecipe(Opcode, getOperand(0), ResultTy, *this,
1540-
*this, getDebugLoc());
1541-
if (auto *UV = getUnderlyingValue())
1542-
New->setUnderlyingValue(UV);
1543-
return New;
1528+
return new VPWidenCastRecipe(Opcode, getOperand(0), ResultTy,
1529+
cast_or_null<CastInst>(getUnderlyingValue()),
1530+
*this, *this, getDebugLoc());
15441531
}
15451532

15461533
VP_CLASSOF_IMPL(VPDef::VPWidenCastSC)
@@ -1585,13 +1572,17 @@ class VPWidenIntrinsicRecipe : public VPRecipeWithIRFlags, public VPIRMetadata {
15851572
public:
15861573
VPWidenIntrinsicRecipe(CallInst &CI, Intrinsic::ID VectorIntrinsicID,
15871574
ArrayRef<VPValue *> CallArguments, Type *Ty,
1575+
const VPIRFlags &Flags = {},
15881576
const VPIRMetadata &MD = {},
15891577
DebugLoc DL = DebugLoc::getUnknown())
1590-
: VPRecipeWithIRFlags(VPDef::VPWidenIntrinsicSC, CallArguments, CI),
1578+
: VPRecipeWithIRFlags(VPDef::VPWidenIntrinsicSC, CallArguments, Flags,
1579+
DL),
15911580
VPIRMetadata(MD), VectorIntrinsicID(VectorIntrinsicID), ResultTy(Ty),
15921581
MayReadFromMemory(CI.mayReadFromMemory()),
15931582
MayWriteToMemory(CI.mayWriteToMemory()),
1594-
MayHaveSideEffects(CI.mayHaveSideEffects()) {}
1583+
MayHaveSideEffects(CI.mayHaveSideEffects()) {
1584+
setUnderlyingValue(&CI);
1585+
}
15951586

15961587
VPWidenIntrinsicRecipe(Intrinsic::ID VectorIntrinsicID,
15971588
ArrayRef<VPValue *> CallArguments, Type *Ty,
@@ -1617,7 +1608,7 @@ class VPWidenIntrinsicRecipe : public VPRecipeWithIRFlags, public VPIRMetadata {
16171608
VPWidenIntrinsicRecipe *clone() override {
16181609
if (Value *CI = getUnderlyingValue())
16191610
return new VPWidenIntrinsicRecipe(*cast<CallInst>(CI), VectorIntrinsicID,
1620-
operands(), ResultTy, *this,
1611+
operands(), ResultTy, *this, *this,
16211612
getDebugLoc());
16221613
return new VPWidenIntrinsicRecipe(VectorIntrinsicID, operands(), ResultTy,
16231614
*this, *this, getDebugLoc());
@@ -1671,10 +1662,11 @@ class LLVM_ABI_FOR_TEST VPWidenCallRecipe : public VPRecipeWithIRFlags,
16711662
public:
16721663
VPWidenCallRecipe(Value *UV, Function *Variant,
16731664
ArrayRef<VPValue *> CallArguments,
1674-
DebugLoc DL = DebugLoc::getUnknown())
1675-
: VPRecipeWithIRFlags(VPDef::VPWidenCallSC, CallArguments,
1676-
*cast<Instruction>(UV)),
1677-
VPIRMetadata(*cast<Instruction>(UV)), Variant(Variant) {
1665+
const VPIRFlags &Flags = {},
1666+
const VPIRMetadata &Metadata = {}, DebugLoc DL = {})
1667+
: VPRecipeWithIRFlags(VPDef::VPWidenCallSC, CallArguments, Flags, DL),
1668+
VPIRMetadata(Metadata), Variant(Variant) {
1669+
setUnderlyingValue(UV);
16781670
assert(
16791671
isa<Function>(getOperand(getNumOperands() - 1)->getLiveInIRValue()) &&
16801672
"last operand must be the called function");
@@ -1684,7 +1676,7 @@ class LLVM_ABI_FOR_TEST VPWidenCallRecipe : public VPRecipeWithIRFlags,
16841676

16851677
VPWidenCallRecipe *clone() override {
16861678
return new VPWidenCallRecipe(getUnderlyingValue(), Variant, operands(),
1687-
getDebugLoc());
1679+
*this, *this, getDebugLoc());
16881680
}
16891681

16901682
VP_CLASSOF_IMPL(VPDef::VPWidenCallSC)
@@ -1761,16 +1753,19 @@ class VPHistogramRecipe : public VPRecipeBase {
17611753
/// instruction.
17621754
struct LLVM_ABI_FOR_TEST VPWidenSelectRecipe : public VPRecipeWithIRFlags,
17631755
public VPIRMetadata {
1764-
VPWidenSelectRecipe(SelectInst &I, ArrayRef<VPValue *> Operands,
1765-
const VPIRMetadata &MD = {})
1766-
: VPRecipeWithIRFlags(VPDef::VPWidenSelectSC, Operands, I),
1767-
VPIRMetadata(MD) {}
1756+
VPWidenSelectRecipe(SelectInst *SI, ArrayRef<VPValue *> Operands,
1757+
const VPIRFlags &Flags = {}, const VPIRMetadata &MD = {},
1758+
DebugLoc DL = {})
1759+
: VPRecipeWithIRFlags(VPDef::VPWidenSelectSC, Operands, Flags, DL),
1760+
VPIRMetadata(MD) {
1761+
setUnderlyingValue(SI);
1762+
}
17681763

17691764
~VPWidenSelectRecipe() override = default;
17701765

17711766
VPWidenSelectRecipe *clone() override {
1772-
return new VPWidenSelectRecipe(*cast<SelectInst>(getUnderlyingInstr()),
1773-
operands(), *this);
1767+
return new VPWidenSelectRecipe(cast<SelectInst>(getUnderlyingInstr()),
1768+
operands(), *this, *this, getDebugLoc());
17741769
}
17751770

17761771
VP_CLASSOF_IMPL(VPDef::VPWidenSelectSC)
@@ -1822,9 +1817,12 @@ class LLVM_ABI_FOR_TEST VPWidenGEPRecipe : public VPRecipeWithIRFlags {
18221817
}
18231818

18241819
public:
1825-
VPWidenGEPRecipe(GetElementPtrInst *GEP, ArrayRef<VPValue *> Operands)
1826-
: VPRecipeWithIRFlags(VPDef::VPWidenGEPSC, Operands, *GEP),
1820+
VPWidenGEPRecipe(GetElementPtrInst *GEP, ArrayRef<VPValue *> Operands,
1821+
const VPIRFlags &Flags = {},
1822+
DebugLoc DL = DebugLoc::getUnknown())
1823+
: VPRecipeWithIRFlags(VPDef::VPWidenGEPSC, Operands, Flags, DL),
18271824
SourceElementTy(GEP->getSourceElementType()) {
1825+
setUnderlyingValue(GEP);
18281826
SmallVector<std::pair<unsigned, MDNode *>> Metadata;
18291827
(void)Metadata;
18301828
getMetadataToPropagate(GEP, Metadata);
@@ -1835,7 +1833,7 @@ class LLVM_ABI_FOR_TEST VPWidenGEPRecipe : public VPRecipeWithIRFlags {
18351833

18361834
VPWidenGEPRecipe *clone() override {
18371835
return new VPWidenGEPRecipe(cast<GetElementPtrInst>(getUnderlyingInstr()),
1838-
operands());
1836+
operands(), *this, getDebugLoc());
18391837
}
18401838

18411839
VP_CLASSOF_IMPL(VPDef::VPWidenGEPSC)
@@ -2929,20 +2927,22 @@ class LLVM_ABI_FOR_TEST VPReplicateRecipe : public VPRecipeWithIRFlags,
29292927
public:
29302928
VPReplicateRecipe(Instruction *I, ArrayRef<VPValue *> Operands,
29312929
bool IsSingleScalar, VPValue *Mask = nullptr,
2932-
VPIRMetadata Metadata = {})
2933-
: VPRecipeWithIRFlags(VPDef::VPReplicateSC, Operands, *I),
2930+
const VPIRFlags &Flags = {}, VPIRMetadata Metadata = {},
2931+
DebugLoc DL = DebugLoc::getUnknown())
2932+
: VPRecipeWithIRFlags(VPDef::VPReplicateSC, Operands, Flags, DL),
29342933
VPIRMetadata(Metadata), IsSingleScalar(IsSingleScalar),
29352934
IsPredicated(Mask) {
2935+
setUnderlyingValue(I);
29362936
if (Mask)
29372937
addOperand(Mask);
29382938
}
29392939

29402940
~VPReplicateRecipe() override = default;
29412941

29422942
VPReplicateRecipe *clone() override {
2943-
auto *Copy =
2944-
new VPReplicateRecipe(getUnderlyingInstr(), operands(), IsSingleScalar,
2945-
isPredicated() ? getMask() : nullptr, *this);
2943+
auto *Copy = new VPReplicateRecipe(
2944+
getUnderlyingInstr(), operands(), IsSingleScalar,
2945+
isPredicated() ? getMask() : nullptr, *this, *this, getDebugLoc());
29462946
Copy->transferFlags(*this);
29472947
return Copy;
29482948
}

llvm/lib/Transforms/Vectorize/VPlanConstruction.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ void PlainCFGBuilder::createVPInstructionsForVPBB(VPBasicBlock *VPBB,
190190
// recipes.
191191
if (Br->isConditional()) {
192192
VPValue *Cond = getOrCreateVPOperand(Br->getCondition());
193-
VPIRBuilder.createNaryOp(VPInstruction::BranchOnCond, {Cond}, Inst,
193+
VPIRBuilder.createNaryOp(VPInstruction::BranchOnCond, {Cond}, Inst, {},
194194
VPIRMetadata(*Inst), Inst->getDebugLoc());
195195
}
196196

@@ -205,7 +205,7 @@ void PlainCFGBuilder::createVPInstructionsForVPBB(VPBasicBlock *VPBB,
205205
SmallVector<VPValue *> Ops = {getOrCreateVPOperand(SI->getCondition())};
206206
for (auto Case : SI->cases())
207207
Ops.push_back(getOrCreateVPOperand(Case.getCaseValue()));
208-
VPIRBuilder.createNaryOp(Instruction::Switch, Ops, Inst,
208+
VPIRBuilder.createNaryOp(Instruction::Switch, Ops, Inst, {},
209209
VPIRMetadata(*Inst), Inst->getDebugLoc());
210210
continue;
211211
}
@@ -255,13 +255,14 @@ void PlainCFGBuilder::createVPInstructionsForVPBB(VPBasicBlock *VPBB,
255255
if (auto *CI = dyn_cast<CastInst>(Inst)) {
256256
NewR = VPIRBuilder.createScalarCast(CI->getOpcode(), VPOperands[0],
257257
CI->getType(), CI->getDebugLoc(),
258-
{}, MD);
258+
VPIRFlags(*CI), MD);
259259
NewR->setUnderlyingValue(CI);
260260
} else {
261261
// Build VPInstruction for any arbitrary Instruction without specific
262262
// representation in VPlan.
263-
NewR = VPIRBuilder.createNaryOp(Inst->getOpcode(), VPOperands, Inst, MD,
264-
Inst->getDebugLoc());
263+
NewR =
264+
VPIRBuilder.createNaryOp(Inst->getOpcode(), VPOperands, Inst,
265+
VPIRFlags(*Inst), MD, Inst->getDebugLoc());
265266
}
266267
}
267268

llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2056,24 +2056,26 @@ bool VPIRFlags::flagsValidForOpcode(unsigned Opcode) const {
20562056
switch (OpType) {
20572057
case OperationType::OverflowingBinOp:
20582058
return Opcode == Instruction::Add || Opcode == Instruction::Sub ||
2059-
Opcode == Instruction::Mul ||
2059+
Opcode == Instruction::Mul || Opcode == Instruction::Shl ||
20602060
Opcode == VPInstruction::VPInstruction::CanonicalIVIncrementForPart;
20612061
case OperationType::Trunc:
20622062
return Opcode == Instruction::Trunc;
20632063
case OperationType::DisjointOp:
20642064
return Opcode == Instruction::Or;
20652065
case OperationType::PossiblyExactOp:
2066-
return Opcode == Instruction::AShr;
2066+
return Opcode == Instruction::AShr || Opcode == Instruction::LShr ||
2067+
Opcode == Instruction::UDiv || Opcode == Instruction::SDiv;
20672068
case OperationType::GEPOp:
20682069
return Opcode == Instruction::GetElementPtr ||
20692070
Opcode == VPInstruction::PtrAdd ||
20702071
Opcode == VPInstruction::WidePtrAdd;
20712072
case OperationType::FPMathOp:
2072-
return Opcode == Instruction::FAdd || Opcode == Instruction::FMul ||
2073-
Opcode == Instruction::FSub || Opcode == Instruction::FNeg ||
2074-
Opcode == Instruction::FDiv || Opcode == Instruction::FRem ||
2075-
Opcode == Instruction::FPExt || Opcode == Instruction::FPTrunc ||
2076-
Opcode == Instruction::FCmp || Opcode == Instruction::Select ||
2073+
return Opcode == Instruction::Call || Opcode == Instruction::FAdd ||
2074+
Opcode == Instruction::FMul || Opcode == Instruction::FSub ||
2075+
Opcode == Instruction::FNeg || Opcode == Instruction::FDiv ||
2076+
Opcode == Instruction::FRem || Opcode == Instruction::FPExt ||
2077+
Opcode == Instruction::FPTrunc || Opcode == Instruction::FCmp ||
2078+
Opcode == Instruction::Select ||
20772079
Opcode == VPInstruction::WideIVStep ||
20782080
Opcode == VPInstruction::ReductionStartVector ||
20792081
Opcode == VPInstruction::ComputeReductionResult;

0 commit comments

Comments
 (0)