[llvm-branch-commits] [llvm] [LoopVectorize][NFC] Refactor widening decision logic (PR #140722)

David Sherwood via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Mon Nov 10 04:58:29 PST 2025


================
@@ -5183,17 +5187,15 @@ LoopVectorizationCostModel::getMemInstScalarizationCost(Instruction *I,
   return Cost;
 }
 
-InstructionCost
-LoopVectorizationCostModel::getConsecutiveMemOpCost(Instruction *I,
-                                                    ElementCount VF) {
+InstructionCost LoopVectorizationCostModel::getConsecutiveMemOpCost(
+    Instruction *I, ElementCount VF, InstWidening Decision) {
   Type *ValTy = getLoadStoreType(I);
   auto *VectorTy = cast<VectorType>(toVectorTy(ValTy, VF));
-  Value *Ptr = getLoadStorePointerOperand(I);
   unsigned AS = getLoadStoreAddressSpace(I);
-  int ConsecutiveStride = Legal->isConsecutivePtr(ValTy, Ptr);
+  enum TTI::TargetCostKind CostKind = TTI::TCK_RecipThroughput;
----------------
david-arm wrote:

I don't think this is correct because we sometimes optimise for size. You can delete this line, since LoopVectorizationCostModel already has a CostKind member.

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


More information about the llvm-branch-commits mailing list