[llvm] [CostModel][AArch64] Make extractelement, with fmul user, free whenev… (PR #111479)
David Green via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 6 00:48:15 PST 2024
================
@@ -1392,6 +1393,16 @@ class TargetTransformInfo {
unsigned Index = -1, Value *Op0 = nullptr,
Value *Op1 = nullptr) const;
+ /// \return The expected cost of vector Insert and Extract.
+ /// Use -1 to indicate that there is no information on the index value.
+ /// This is used when the instruction is not available; a typical use
+ /// case is to provision the cost of vectorization/scalarization in
+ /// vectorizer passes.
+ InstructionCost getVectorInstrCost(
+ unsigned Opcode, Type *Val, TTI::TargetCostKind CostKind, unsigned Index,
+ Value *Scalar,
+ ArrayRef<std::tuple<Value *, User *, int>> ScalarUserAndIdx) const;
----------------
davemgreen wrote:
Can you try to explain these parameters in the description (hopefully in a way that doesn't sound tightly coupled with the SLP vectorizer). I don't know of a better way of passing the information this needs, if it needs to know that the user of the imaginary extract has operands which are also imaginary extracts. I'm wondering if there is a better/higher level way, or maybe we don't need to be quite so precise and just say that the extract to a mul is free. Maybe we just need to work on reducing the cost of an fp extract to 1. I wasn't able to look at this patch as much as I would have liked as all the tests are failing.
https://github.com/llvm/llvm-project/pull/111479
More information about the llvm-commits
mailing list