[PATCH] D157462: LoopRotate: Add code to update branch weights
Matthias Braun via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Aug 15 10:41:14 PDT 2023
MatzeB marked 2 inline comments as done.
MatzeB added inline comments.
================
Comment at: llvm/lib/Transforms/Utils/LoopRotationUtils.cpp:302
+ // probabilities as if 0-trip count never happens.
+ ExitCount0 = 0;
+ } else {
----------------
wenlei wrote:
> Heuristic is somewhat arbitrary anyways but I would still keep `ExitCount0` as non-zero, so it's a "live" path to be conservative. Also BFI doesn't like zero edge counts is another reason..
I had that in earlier versions, but my experience while writing the tests anyway was that BFI handles zero-count-edges fine and the results just seem more natural and easier to reason about this way. While assigning non-zero immediately felt somewhat murky in what sort of "epsilon" should be used at all...
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D157462/new/
https://reviews.llvm.org/D157462
More information about the llvm-commits
mailing list