[llvm] [AArch64,TTI] Remove RealUse check for vector insert/extract costs. (PR #146526)

David Green via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 14 03:57:55 PDT 2025


================
@@ -3887,25 +3885,24 @@ InstructionCost AArch64TTIImpl::getVectorInstrCost(unsigned Opcode, Type *Val,
                                                    unsigned Index,
                                                    const Value *Op0,
                                                    const Value *Op1) const {
-  bool HasRealUse =
-      Opcode == Instruction::InsertElement && Op0 && !isa<UndefValue>(Op0);
-  return getVectorInstrCostHelper(Opcode, Val, CostKind, Index, HasRealUse);
+  if (Index == 0 && Op0 && isa<PoisonValue>(Op0))
----------------
davemgreen wrote:

Can we add a comment explaining why this is added? It will likely help in the future if we try to make splat costs more precise.

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


More information about the llvm-commits mailing list