[llvm] [SimplifyCFG][PGO] Reuse existing `setBranchWeights` (PR #160629)

Matthias Braun via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 30 10:20:19 PDT 2025


================
@@ -209,10 +209,10 @@ loop_exit:
 
 ; IR-LABEL: define void @func5_zero_branch_weight
 ; IR: entry:
-; IR:   br i1 %cmp1, label %loop_exit, label %loop_body.lr.ph, !prof [[PROF_FUNC5_0:![0-9]+]]
+; IR:   br i1 %cmp1, label %loop_exit, label %loop_body.lr.ph
----------------
MatzeB wrote:

I don't think it matters as far as `LoopRotate` is concerned. But what's the point of doing extra checking for all zero in the setter function and possibly removing the annotation there. Wouldn't it be simpler and more obvious if the functions just sets the values as given and we use a separate function if you want to remove the weights?

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


More information about the llvm-commits mailing list