[llvm] [VPlan] Get Addr computation cost with scalar type if it is uniform for gather/scatter. (PR #150371)
Luke Lau via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 7 18:56:23 PDT 2025
================
@@ -6932,6 +6932,12 @@ static bool planContainsAdditionalSimplifications(VPlan &Plan,
auto Iter = vp_depth_first_deep(Plan.getVectorLoopRegion()->getEntry());
for (VPBasicBlock *VPBB : VPBlockUtils::blocksOnly<VPBasicBlock>(Iter)) {
for (VPRecipeBase &R : *VPBB) {
+ if (auto *MR = dyn_cast<VPWidenMemoryRecipe>(&R)) {
+ // The address computation cost can be query as scalar type if the
+ // address is uniform.
+ if (!MR->isConsecutive() && vputils::isSingleScalar(MR->getAddr()))
+ return true;
----------------
lukel97 wrote:
Were you seeing any cost model assertions with this PR? I guess the VPlan cost model never passed in the pointer SCEV to begin with so is it already out of sync on other targets?
https://github.com/llvm/llvm-project/pull/150371
More information about the llvm-commits
mailing list