[llvm] [LV] Use getFixedValue instead of getKnownMinValue when appropriate (PR #143526)

David Sherwood via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 13 07:43:49 PDT 2025


================
@@ -5342,6 +5342,10 @@ LoopVectorizationCostModel::getUniformMemOpCost(Instruction *I,
   StoreInst *SI = cast<StoreInst>(I);
 
   bool IsLoopInvariantStoreValue = Legal->isInvariant(SI->getValueOperand());
+  // TODO: We have tests that request the cost of extracting element
+  // VF.getKnownMinValue() - 1 from a scalable vector. This is actually
+  // meaningless, given what we actually want is the last lane and is likely
+  // to be more expensive.
----------------
david-arm wrote:

Hi @fhahn @lukel97 I've created a PR to add support for querying the cost of extracting the last lane in a scalable vector. I'll add reviewers (and split up the PR if necessary) if you think it looks good! https://github.com/llvm/llvm-project/pull/144086

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


More information about the llvm-commits mailing list