[llvm] [LV][NFC] Autogen a test with integer costs per lane (PR #201560)

Paul Walker via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 4 06:24:57 PDT 2026


================
@@ -5769,7 +5776,10 @@ InstructionCost LoopVectorizationPlanner::cost(VPlan &Plan, ElementCount VF,
                     << " (Estimated cost per lane: ");
   if (Cost.isValid()) {
     double CostPerLane = double(Cost.getValue()) / EstimatedWidth;
-    LLVM_DEBUG(dbgs() << format("%.1f", CostPerLane));
+    if (PrintIntCostsPerLane)
+      LLVM_DEBUG(dbgs() << format("%.0f", CostPerLane));
+    else
+      LLVM_DEBUG(dbgs() << format("%.1f", CostPerLane));
----------------
paulwalker-arm wrote:

Would it be simpler to instead add a flag that controls the output of this metric?

>From a testing point of view the metric has no value? It's essentially just verifying we can do floating point division and thus can be disabled by default? Presumably the real value is for people manually reading the debug?

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


More information about the llvm-commits mailing list