[PATCH] D17864: [PGO] Promote indirect calls to conditional direct calls with value-profile

Johan Engelen via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 7 11:05:34 PDT 2016


johanengelen added a comment.

(thanks for your work on this btw! ;)


================
Comment at: test/Transforms/PGOProfile/icp_vararg.ll:33
@@ +32,2 @@
+!1 = !{!"VP", i32 0, i64 12345, i64 989055279648259519, i64 12345}
+; ICALL-PROM: [[BRANCH_WEIGHT]] = !{!"branch_weights", i32 12345, i32 0}
----------------
I think the branch_weights are calculated slightly wrong.
branch_weights usually have an offset of 1, where 1 means there is no profile measurement that it was taken. See the documentation of scaleBranchWeight in CodeGenPGO.cpp of Clang.


http://reviews.llvm.org/D17864





More information about the llvm-commits mailing list