[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


================
@@ -5617,14 +5618,8 @@ void LoopVectorizationCostModel::setCostBasedWideningDecision(ElementCount VF) {
       }
 
       // We assume that widening is the best solution when possible.
-      if (memoryInstructionCanBeWidened(&I, VF)) {
-        InstructionCost Cost = getConsecutiveMemOpCost(&I, VF);
-        int ConsecutiveStride = Legal->isConsecutivePtr(
-            getLoadStoreType(&I), getLoadStorePointerOperand(&I));
-        assert((ConsecutiveStride == 1 || ConsecutiveStride == -1) &&
----------------
david-arm wrote:

This assert can be moved to `memoryInstructionCanBeWidened`.

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


More information about the llvm-branch-commits mailing list