[llvm] [AArch64][CostModel] Consider the cost of const vector (PR #117539)

Sushant Gokhale via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 25 03:21:59 PST 2024


================
@@ -235,10 +235,17 @@ class AArch64TTIImpl : public BasicTTIImplBase<AArch64TTIImpl> {
   bool useNeonVector(const Type *Ty) const;
 
   InstructionCost
-  getMemoryOpCost(unsigned Opcode, Type *Src, MaybeAlign Alignment,
-                  unsigned AddressSpace, TTI::TargetCostKind CostKind,
-                  TTI::OperandValueInfo OpInfo = {TTI::OK_AnyValue, TTI::OP_None},
-                  const Instruction *I = nullptr);
+  getConstVectCost(unsigned Opcode, Type *Src, MaybeAlign Alignment,
+                   unsigned AddressSpace, TTI::TargetCostKind CostKind,
+                   TTI::OperandValueInfo OpInfo, const Instruction *I,
+                   const bool SrcIsConstVect, InstructionCost ScalarCost);
+
+  InstructionCost getMemoryOpCost(
+      unsigned Opcode, Type *Src, MaybeAlign Alignment, unsigned AddressSpace,
+      TTI::TargetCostKind CostKind,
+      TTI::OperandValueInfo OpInfo = {TTI::OK_AnyValue, TTI::OP_None},
+      const Instruction *I = nullptr, const bool SrcIsConstVect = false,
+      InstructionCost ScalarCost = 10000);
----------------
sushgokh wrote:

Maybe I should change to `ConstVectorScalarCost` if thats what you are thinking?

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


More information about the llvm-commits mailing list