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

Mel Chen via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 27 23:48:59 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);
+  Type *PtrTy = Ptr->getType();
+
+  if (!Legal->isUniform(Ptr, VF))
----------------
Mel-Chen wrote:

Why use isUniform here? What is the difference between isUniformAfterVectorization?

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


More information about the llvm-commits mailing list