[llvm] [WIP][VPlan] Use BlockFrequencyInfo in getPredBlockCostDivisor (PR #158690)

Luke Lau via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 23 05:41:51 PDT 2025


================
@@ -65,7 +65,7 @@ for.body:
   %r = phi i64 [ 0, %entry ], [ %var6, %for.inc ]
   %var0 = getelementptr inbounds i64, ptr %a, i64 %i
   %var2 = load i64, ptr %var0, align 4
-  %cond0 = icmp sgt i64 %var2, 0
+  %cond0 = icmp sgt i64 %var2, 1
----------------
lukel97 wrote:

This constant was changed to keep the old branch probability the same and keep the block scalarized, since with BFI `icmp sgt %x, 0` is predicted to be slightly > 50%. 

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


More information about the llvm-commits mailing list