[llvm] [LV] Align legacy cost model to vplan-based model for gather/scatter w/ uniform addr. (PR #155739)

Elvis Wang via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 28 00:06:12 PDT 2025


================
@@ -5256,8 +5256,11 @@ LoopVectorizationCostModel::getGatherScatterCost(Instruction *I,
   Type *ValTy = getLoadStoreType(I);
   auto *VectorTy = cast<VectorType>(toVectorTy(ValTy, VF));
   const Align Alignment = getLoadStoreAlignment(I);
-  const Value *Ptr = getLoadStorePointerOperand(I);
-  Type *PtrTy = toVectorTy(Ptr->getType(), VF);
+  Value *Ptr = getLoadStorePointerOperand(I);
----------------
ElvisWang123 wrote:

Without this, will need `isUniform(const_cast<Value *>(Prt), VF)`
I am not sure which is better.

https://github.com/llvm/llvm-project/pull/155739


More information about the llvm-commits mailing list