[llvm] [NFC][TTI] Remove default CostKind from TTI::getMemoryOpCost() (PR #219070)
Ryan Buchner via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 26 16:06:12 PDT 2026
https://github.com/bababuck created https://github.com/llvm/llvm-project/pull/219070
Addresses #135598.
>From 2119877c2ccd00e41b19cd64defd25aae3da7c18 Mon Sep 17 00:00:00 2001
From: bababuck <buchner.ryan at gmail.com>
Date: Wed, 26 Aug 2026 15:55:31 -0700
Subject: [PATCH] [NFC][TTI] Remove default CostKind from
TTI::getMemoryOpCost()
Addresses #135598.
---
llvm/include/llvm/Analysis/TargetTransformInfo.h | 2 +-
llvm/lib/Transforms/Scalar/LowerMatrixIntrinsics.cpp | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/llvm/include/llvm/Analysis/TargetTransformInfo.h b/llvm/include/llvm/Analysis/TargetTransformInfo.h
index bfe901797efb1..edef5a86d1018 100644
--- a/llvm/include/llvm/Analysis/TargetTransformInfo.h
+++ b/llvm/include/llvm/Analysis/TargetTransformInfo.h
@@ -1704,7 +1704,7 @@ class TargetTransformInfo {
/// for loads.
LLVM_ABI InstructionCost getMemoryOpCost(
unsigned Opcode, Type *Src, Align Alignment, unsigned AddressSpace,
- TTI::TargetCostKind CostKind = TTI::TCK_RecipThroughput,
+ TTI::TargetCostKind CostKind,
OperandValueInfo OpdInfo = {OK_AnyValue, OP_None},
const Instruction *I = nullptr) const;
diff --git a/llvm/lib/Transforms/Scalar/LowerMatrixIntrinsics.cpp b/llvm/lib/Transforms/Scalar/LowerMatrixIntrinsics.cpp
index 9df0894894250..0f88ae7fb2c74 100644
--- a/llvm/lib/Transforms/Scalar/LowerMatrixIntrinsics.cpp
+++ b/llvm/lib/Transforms/Scalar/LowerMatrixIntrinsics.cpp
@@ -1658,8 +1658,8 @@ class LowerMatrixIntrinsics {
if (N == 1)
return InstructionCost(0);
- return TTI.getMemoryOpCost(Instruction::Load, VecTy, Align(1), 0) -
- N * TTI.getMemoryOpCost(Instruction::Load, EltTy, Align(1), 0);
+ return TTI.getMemoryOpCost(Instruction::Load, VecTy, Align(1), 0, CostKind) -
+ N * TTI.getMemoryOpCost(Instruction::Load, EltTy, Align(1), 0, CostKind);
};
// Iterate over LHS and operations feeding LHS and check if it is profitable
More information about the llvm-commits
mailing list