[llvm] [Analysis] Use BaseT::getArithmeticInstrCost() as the base cost for RecipThroughput (PR #176515)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 16 23:25:50 PST 2026


================
@@ -1058,9 +1058,13 @@ class BasicTTIImplBase : public TargetTransformInfoImplCRTPBase<T> {
     std::pair<InstructionCost, MVT> LT = getTypeLegalizationCost(Ty);
 
     bool IsFloat = Ty->isFPOrFPVectorTy();
-    // Assume that floating point arithmetic operations cost twice as much as
-    // integer operations.
-    InstructionCost OpCost = (IsFloat ? 2 : 1);
+    InstructionCost OpCost;
+    if (IsFloat)
+      // Should update to Expensive? For now just want to modify integer costing
----------------
arsenm wrote:

Integer division is more expensive than floating point 

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


More information about the llvm-commits mailing list