Skip to content

Commit 341b36f

Browse files
committed
[VPlan] Strip VPVectorPointerRecipe::getOpcode
1 parent 93ce4ff commit 341b36f

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

llvm/lib/Transforms/Vectorize/VPlan.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1900,9 +1900,6 @@ class VPVectorPointerRecipe : public VPRecipeWithIRFlags,
19001900

19011901
VP_CLASSOF_IMPL(VPDef::VPVectorPointerSC)
19021902

1903-
/// This recipe primarily generates a GEP instruction.
1904-
unsigned getOpcode() const { return Instruction::GetElementPtr; }
1905-
19061903
void execute(VPTransformState &State) override;
19071904

19081905
bool onlyFirstLaneUsed(const VPValue *Op) const override {

llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1978,8 +1978,7 @@ struct VPCSEDenseMapInfo : public DenseMapInfo<VPSingleDefRecipe *> {
19781978
return TypeSwitch<const VPSingleDefRecipe *,
19791979
std::optional<std::pair<bool, unsigned>>>(R)
19801980
.Case<VPInstruction, VPWidenRecipe, VPWidenCastRecipe,
1981-
VPWidenSelectRecipe, VPWidenGEPRecipe, VPReplicateRecipe,
1982-
VPVectorPointerRecipe>(
1981+
VPWidenSelectRecipe, VPWidenGEPRecipe, VPReplicateRecipe>(
19831982
[](auto *I) { return std::make_pair(false, I->getOpcode()); })
19841983
.Case<VPWidenIntrinsicRecipe>([](auto *I) {
19851984
return std::make_pair(true, I->getVectorIntrinsicID());
@@ -1991,8 +1990,11 @@ struct VPCSEDenseMapInfo : public DenseMapInfo<VPSingleDefRecipe *> {
19911990
static bool canHandle(const VPSingleDefRecipe *Def) {
19921991
// We can extend the list of handled recipes in the future,
19931992
// provided we account for the data embedded in them while checking for
1994-
// equality or hashing.
1995-
auto C = getOpcodeOrIntrinsicID(Def);
1993+
// equality or hashing. We assign VPVectorEndPointerRecipe the GEP opcode,
1994+
// as it is essentially a GEP with different semantics.
1995+
auto C = isa<VPVectorPointerRecipe>(Def)
1996+
? std::make_pair(false, Instruction::GetElementPtr)
1997+
: getOpcodeOrIntrinsicID(Def);
19961998

19971999
// The issue with (Insert|Extract)Value is that the index of the
19982000
// insert/extract is not a proper operand in LLVM IR, and hence also not in

0 commit comments

Comments
 (0)