[llvm] [LoopVectorize][NFC] Rewrite tests to check output of vplan cost model (PR #113697)

David Sherwood via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 14 07:53:25 PST 2024


================
@@ -7403,7 +7404,20 @@ InstructionCost LoopVectorizationPlanner::cost(VPlan &Plan,
 
   // Now compute and add the VPlan-based cost.
   Cost += Plan.cost(VF, CostCtx);
-  LLVM_DEBUG(dbgs() << "Cost for VF " << VF << ": " << Cost << "\n");
+#ifndef NDEBUG
+  unsigned EstimatedWidth = VF.getKnownMinValue();
+  if (VF.isScalable())
+    if (std::optional<unsigned> VScale = getVScaleForTuning(OrigLoop, TTI))
+      EstimatedWidth *= *VScale;
----------------
david-arm wrote:

Good suggestion! I've created https://github.com/llvm/llvm-project/pull/116247

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


More information about the llvm-commits mailing list