[llvm] [NFC][TTI] Remove default CostKind from TTI::getArithmeticInstrCost (PR #218465)

Ryan Buchner via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 24 10:54:08 PDT 2026


================
@@ -642,10 +642,11 @@ static void visitIVCast(CastInst *Cast, WideIVInfo &WI,
   // because at least an ADD is required to increment the induction variable. We
   // could compute more comprehensively the cost of all instructions on the
   // induction variable when necessary.
-  if (TTI &&
-      TTI->getArithmeticInstrCost(Instruction::Add, Ty) >
-          TTI->getArithmeticInstrCost(Instruction::Add,
-                                      Cast->getOperand(0)->getType())) {
+  constexpr TTI::TargetCostKind CostKind = TTI::TCK_RecipThroughput;
----------------
bababuck wrote:

Not even a vanilla `const`? Making the change now, but curious as to why?

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


More information about the llvm-commits mailing list