[PATCH] D73398: In SCEV's printer pass, print an estimate of the exit count for each exit from profiling information

Philip Reames via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 27 10:28:21 PST 2020


reames marked an inline comment as done.
reames added inline comments.


================
Comment at: llvm/test/Analysis/ScalarEvolution/trip-count.ll:143
+  %becond = icmp ne i32 %iv.inc, 20
+  br i1 %becond, label %loop, label %leave, !prof !{!"branch_weights", i32 20, i32 1}
+
----------------
nikic wrote:
> Why are the branch weights here 20/1 and not 19/1 (and relatedly, why do we need to subtract -1 in the exit count calculation)?
Because I made a mental off by one error, and then made everything else consistent with that mistake.  Oops.  :)

I was thinking in iterations not backedges taken.  Despite the comments which say the opposite.  

Thanks for catching that!


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D73398/new/

https://reviews.llvm.org/D73398





More information about the llvm-commits mailing list