[llvm] [NFC] Remove default CostKind from multiple TTI functions (PR #218547)
via llvm-commits
llvm-commits at lists.llvm.org
Mon Aug 24 15:56:57 PDT 2026
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff origin/main HEAD --extensions h -- llvm/include/llvm/Analysis/TargetTransformInfo.h --diff_from_common_commit
``````````
:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/llvm/include/llvm/Analysis/TargetTransformInfo.h b/llvm/include/llvm/Analysis/TargetTransformInfo.h
index dda5c3772..fe7122a02 100644
--- a/llvm/include/llvm/Analysis/TargetTransformInfo.h
+++ b/llvm/include/llvm/Analysis/TargetTransformInfo.h
@@ -1550,10 +1550,10 @@ public:
/// selected by \p OpcodeMask. The mask contains one bit per lane and is a `0`
/// when \p Opcode0 is selected and `1` when Opcode1 is selected.
/// \p VecTy is the vector type of the instruction to be generated.
- LLVM_ABI InstructionCost getAltInstrCost(
- VectorType *VecTy, unsigned Opcode0, unsigned Opcode1,
- const SmallBitVector &OpcodeMask,
- TTI::TargetCostKind CostKind) const;
+ LLVM_ABI InstructionCost getAltInstrCost(VectorType *VecTy, unsigned Opcode0,
+ unsigned Opcode1,
+ const SmallBitVector &OpcodeMask,
+ TTI::TargetCostKind CostKind) const;
/// \return The cost of a shuffle instruction of kind Kind with inputs of type
/// SrcTy, producing a vector of type DstTy. The exact mask may be passed as
@@ -1609,8 +1609,7 @@ public:
/// may be passed in the 'I' parameter.
LLVM_ABI InstructionCost getCastInstrCost(
unsigned Opcode, Type *Dst, Type *Src, TTI::CastContextHint CCH,
- TTI::TargetCostKind CostKind,
- const Instruction *I = nullptr) const;
+ TTI::TargetCostKind CostKind, const Instruction *I = nullptr) const;
/// \return The expected cost of a sign- or zero-extended vector extract. Use
/// Index = -1 to indicate that there is no information about the index value.
@@ -1620,9 +1619,9 @@ public:
/// \return The expected cost of control-flow related instructions such as
/// Phi, Ret, Br, Switch.
- LLVM_ABI InstructionCost getCFInstrCost(
- unsigned Opcode, TTI::TargetCostKind CostKind,
- const Instruction *I = nullptr) const;
+ LLVM_ABI InstructionCost getCFInstrCost(unsigned Opcode,
+ TTI::TargetCostKind CostKind,
+ const Instruction *I = nullptr) const;
/// \returns The expected cost of compare and select instructions. If there
/// is an existing instruction that holds Opcode, it may be passed in the
@@ -1631,12 +1630,12 @@ public:
/// types are passed, \p VecPred must be used for all lanes. For a
/// comparison, the two operands are the natural values. For a select, the
/// two operands are the *value* operands, not the condition operand.
- LLVM_ABI InstructionCost getCmpSelInstrCost(
- unsigned Opcode, Type *ValTy, Type *CondTy, CmpInst::Predicate VecPred,
- TTI::TargetCostKind CostKind,
- OperandValueInfo Op1Info = {OK_AnyValue, OP_None},
- OperandValueInfo Op2Info = {OK_AnyValue, OP_None},
- const Instruction *I = nullptr) const;
+ LLVM_ABI InstructionCost
+ getCmpSelInstrCost(unsigned Opcode, Type *ValTy, Type *CondTy,
+ CmpInst::Predicate VecPred, TTI::TargetCostKind CostKind,
+ OperandValueInfo Op1Info = {OK_AnyValue, OP_None},
+ OperandValueInfo Op2Info = {OK_AnyValue, OP_None},
+ const Instruction *I = nullptr) const;
/// \return The expected cost of vector Insert and Extract.
/// Use -1 to indicate that there is no information on the index value.
@@ -1719,8 +1718,7 @@ public:
/// \p UseMaskForGaps indicates if gaps should be masked.
LLVM_ABI InstructionCost getInterleavedMemoryOpCost(
unsigned Opcode, Type *VecTy, unsigned Factor, ArrayRef<unsigned> Indices,
- Align Alignment, unsigned AddressSpace,
- TTI::TargetCostKind CostKind,
+ Align Alignment, unsigned AddressSpace, TTI::TargetCostKind CostKind,
bool UseMaskForCond = false, bool UseMaskForGaps = false) const;
/// A helper function to determine the type of reduction algorithm used
@@ -1766,9 +1764,9 @@ public:
/// optional extensions. This is the cost of as:
/// * ResTy vecreduce.add/sub(mul (A, B)) or,
/// * ResTy vecreduce.add/sub(mul(ext(Ty A), ext(Ty B)).
- LLVM_ABI InstructionCost getMulAccReductionCost(
- bool IsUnsigned, unsigned RedOpcode, Type *ResTy, VectorType *Ty,
- TTI::TargetCostKind CostKind) const;
+ LLVM_ABI InstructionCost
+ getMulAccReductionCost(bool IsUnsigned, unsigned RedOpcode, Type *ResTy,
+ VectorType *Ty, TTI::TargetCostKind CostKind) const;
/// Calculate the cost of an extended reduction pattern, similar to
/// getArithmeticReductionCost of a reduction with an extension.
@@ -1776,8 +1774,7 @@ public:
/// ResTy vecreduce.opcode(ext(Ty A)).
LLVM_ABI InstructionCost getExtendedReductionCost(
unsigned Opcode, bool IsUnsigned, Type *ResTy, VectorType *Ty,
- std::optional<FastMathFlags> FMF,
- TTI::TargetCostKind CostKind) const;
+ std::optional<FastMathFlags> FMF, TTI::TargetCostKind CostKind) const;
/// \returns The cost of Intrinsic instructions. Analyses the real arguments.
/// Three cases are handled: 1. scalar instruction 2. vector instruction
@@ -1792,9 +1789,9 @@ public:
TTI::TargetCostKind CostKind) const;
/// \returns The cost of Call instructions.
- LLVM_ABI InstructionCost getCallInstrCost(
- Function *F, Type *RetTy, ArrayRef<Type *> Tys,
- TTI::TargetCostKind CostKind) const;
+ LLVM_ABI InstructionCost getCallInstrCost(Function *F, Type *RetTy,
+ ArrayRef<Type *> Tys,
+ TTI::TargetCostKind CostKind) const;
/// \returns The number of pieces into which the provided type must be
/// split during legalization. Zero is returned when the answer is unknown.
``````````
</details>
https://github.com/llvm/llvm-project/pull/218547
More information about the llvm-commits
mailing list