aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorFlorian Hahn <flo@fhahn.com>2025-04-20 10:36:55 +0100
committerFlorian Hahn <flo@fhahn.com>2025-04-20 10:38:30 +0100
commit366ff3a89880139a132fe2738f36b39c89f5333e (patch)
tree47dcd21e57bda2b7327f31c468ee0e994935775a /llvm/lib/Transforms
parent8553efd2e98575fbee2c81a334ec28b12e055406 (diff)
downloadllvm-366ff3a89880139a132fe2738f36b39c89f5333e.zip
llvm-366ff3a89880139a132fe2738f36b39c89f5333e.tar.gz
llvm-366ff3a89880139a132fe2738f36b39c89f5333e.tar.bz2
[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.
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp b/llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp
index 2cc558f..ff1ad29 100644
--- a/llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp
+++ b/llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp
@@ -2684,8 +2684,8 @@ InstructionCost VPWidenMemoryRecipe::computeCost(ElementCount VF,
Type *Ty = toVectorTy(getLoadStoreType(&Ingredient), VF);
const Align Alignment =
getLoadStoreAlignment(const_cast<Instruction *>(&Ingredient));
- unsigned AS =
- getLoadStoreAddressSpace(const_cast<Instruction *>(&Ingredient));
+ unsigned AS = cast<PointerType>(Ctx.Types.inferScalarType(getAddr()))
+ ->getAddressSpace();
if (!Consecutive) {
// TODO: Using the original IR may not be accurate.