Skip to content

Commit 366ff3a

Browse files
committed
[VPlan] Get address space from inferred pointer type (NFC)
Remove a use of the underlying ingredient by getting the address space from the inferred pointer type.
1 parent 8553efd commit 366ff3a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2684,8 +2684,8 @@ InstructionCost VPWidenMemoryRecipe::computeCost(ElementCount VF,
26842684
Type *Ty = toVectorTy(getLoadStoreType(&Ingredient), VF);
26852685
const Align Alignment =
26862686
getLoadStoreAlignment(const_cast<Instruction *>(&Ingredient));
2687-
unsigned AS =
2688-
getLoadStoreAddressSpace(const_cast<Instruction *>(&Ingredient));
2687+
unsigned AS = cast<PointerType>(Ctx.Types.inferScalarType(getAddr()))
2688+
->getAddressSpace();
26892689

26902690
if (!Consecutive) {
26912691
// TODO: Using the original IR may not be accurate.

0 commit comments

Comments
 (0)