[llvm] [LV] Use getFixedValue instead of getKnownMinValue when appropriate (PR #143526)
David Sherwood via llvm-commits
llvm-commits at lists.llvm.org
Wed Jun 11 03:02:45 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:
So I'm looking at changing the `getVectorInstrCost` interface to add support for other "unknown" indices that are more meaningful, such as the last element of a vector. In the meantime, I'm happy to update the comment. There are already quite a few tests exercising this code path (since we make different vectorisation decisions with my downstream patch). Once I've got something working I'll put up a WIP patch for people to look at.
https://github.com/llvm/llvm-project/pull/143526
More information about the llvm-commits
mailing list