-
Notifications
You must be signed in to change notification settings - Fork 15.4k
[VPlan] Fix opcode in LoadStore EVL recipe #170594
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
@llvm/pr-subscribers-vectorizers Author: Shih-Po Hung (arcbbb) ChangesAfter #169885 lands, vp_load/vp_store are handled by getMemIntrinsicInstrCost, so we can use the correct opcode here. Full diff: https://github.com/llvm/llvm-project/pull/170594.diff 1 Files Affected:
diff --git a/llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp b/llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp
index 4d46478aa7373..7b159b3a9c5eb 100644
--- a/llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp
+++ b/llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp
@@ -3606,10 +3606,8 @@ InstructionCost VPWidenLoadEVLRecipe::computeCost(ElementCount VF,
Type *Ty = toVectorTy(getLoadStoreType(&Ingredient), VF);
unsigned AS = cast<PointerType>(Ctx.Types.inferScalarType(getAddr()))
->getAddressSpace();
- // FIXME: getMaskedMemoryOpCost assumes masked_* intrinsics.
- // After migrating to getMemIntrinsicInstrCost, switch this to vp_load.
InstructionCost Cost = Ctx.TTI.getMemIntrinsicInstrCost(
- MemIntrinsicCostAttributes(Intrinsic::masked_load, Ty, Alignment, AS),
+ MemIntrinsicCostAttributes(Intrinsic::vp_load, Ty, Alignment, AS),
Ctx.CostKind);
if (!Reverse)
return Cost;
@@ -3718,10 +3716,8 @@ InstructionCost VPWidenStoreEVLRecipe::computeCost(ElementCount VF,
Type *Ty = toVectorTy(getLoadStoreType(&Ingredient), VF);
unsigned AS = cast<PointerType>(Ctx.Types.inferScalarType(getAddr()))
->getAddressSpace();
- // FIXME: getMaskedMemoryOpCost assumes masked_* intrinsics.
- // After migrating to getMemIntrinsicInstrCost, switch this to vp_store.
InstructionCost Cost = Ctx.TTI.getMemIntrinsicInstrCost(
- MemIntrinsicCostAttributes(Intrinsic::masked_store, Ty, Alignment, AS),
+ MemIntrinsicCostAttributes(Intrinsic::vp_store, Ty, Alignment, AS),
Ctx.CostKind);
if (!Reverse)
return Cost;
|
|
@llvm/pr-subscribers-llvm-transforms Author: Shih-Po Hung (arcbbb) ChangesAfter #169885 lands, vp_load/vp_store are handled by getMemIntrinsicInstrCost, so we can use the correct opcode here. Full diff: https://github.com/llvm/llvm-project/pull/170594.diff 1 Files Affected:
diff --git a/llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp b/llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp
index 4d46478aa7373..7b159b3a9c5eb 100644
--- a/llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp
+++ b/llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp
@@ -3606,10 +3606,8 @@ InstructionCost VPWidenLoadEVLRecipe::computeCost(ElementCount VF,
Type *Ty = toVectorTy(getLoadStoreType(&Ingredient), VF);
unsigned AS = cast<PointerType>(Ctx.Types.inferScalarType(getAddr()))
->getAddressSpace();
- // FIXME: getMaskedMemoryOpCost assumes masked_* intrinsics.
- // After migrating to getMemIntrinsicInstrCost, switch this to vp_load.
InstructionCost Cost = Ctx.TTI.getMemIntrinsicInstrCost(
- MemIntrinsicCostAttributes(Intrinsic::masked_load, Ty, Alignment, AS),
+ MemIntrinsicCostAttributes(Intrinsic::vp_load, Ty, Alignment, AS),
Ctx.CostKind);
if (!Reverse)
return Cost;
@@ -3718,10 +3716,8 @@ InstructionCost VPWidenStoreEVLRecipe::computeCost(ElementCount VF,
Type *Ty = toVectorTy(getLoadStoreType(&Ingredient), VF);
unsigned AS = cast<PointerType>(Ctx.Types.inferScalarType(getAddr()))
->getAddressSpace();
- // FIXME: getMaskedMemoryOpCost assumes masked_* intrinsics.
- // After migrating to getMemIntrinsicInstrCost, switch this to vp_store.
InstructionCost Cost = Ctx.TTI.getMemIntrinsicInstrCost(
- MemIntrinsicCostAttributes(Intrinsic::masked_store, Ty, Alignment, AS),
+ MemIntrinsicCostAttributes(Intrinsic::vp_store, Ty, Alignment, AS),
Ctx.CostKind);
if (!Reverse)
return Cost;
|
lukel97
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
fhahn
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice, LGTM thanks
After llvm#169885 lands, vp_load/vp_store are handled by getMemIntrinsicInstrCost, so we can use the correct opcode here.
After llvm#169885 lands, vp_load/vp_store are handled by getMemIntrinsicInstrCost, so we can use the correct opcode here.
After #169885 lands, vp_load/vp_store are handled by getMemIntrinsicInstrCost, so we can use the correct opcode here.