[llvm] [LV] Use vscale for tuning to improve branch weight estimates (PR #144733)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 27 03:19:26 PDT 2025


================
@@ -3328,8 +3328,8 @@ void VPlanTransforms::narrowInterleaveGroups(VPlan &Plan, ElementCount VF,
 
 /// Add branch weight metadata, if the \p Plan's middle block is terminated by a
 /// BranchOnCond recipe.
-void VPlanTransforms::addBranchWeightToMiddleTerminator(VPlan &Plan,
-                                                        ElementCount VF) {
+void VPlanTransforms::addBranchWeightToMiddleTerminator(
+    VPlan &Plan, ElementCount VF, std::optional<unsigned> VScale) {
----------------
fhahn wrote:

```suggestion
    VPlan &Plan, ElementCount VF, std::optional<unsigned> VScaleForTuning) {
```

seems slightly clearer, same for above?

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


More information about the llvm-commits mailing list