[PATCH] D120096: PGOInstrumentation, GCOVProfiling: Split indirectbr critical edges regardless of PHIs

Matthias Braun via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 23 16:28:28 PST 2022


MatzeB added inline comments.


================
Comment at: llvm/test/Transforms/PGOProfile/irreducible.ll:142
 ; USE: ![[SW_BB15_IRR_LOOP]] = !{!"loop_header_weight", i64 100}
-; USE: ![[INDIRECTGOTO_IRR_LOOP]] = !{!"loop_header_weight", i64 400}
+; USE: ![[INDIRECTGOTO_IRR_LOOP]] = !{!"loop_header_weight", i64 399}
----------------
modimo wrote:
> MatzeB wrote:
> > modimo wrote:
> > > I'm curious how the counters shifted around now that indirectgoto->sw.bb gets split. How does the changed counter values in the profiles above map to that?
> > This is hard to figure out given the size of the test and the fact that the profile files are checked-in as-is. I hope this is fine...
> Took a look because I was curious how to get this information. Adding `-debug-only=pgo-instrumentation` dumps the edges and the instrumented edges line up with the counts in the profile. Comparing the two (irreducible.proftext) left is original right is with this diff:
> {F22208556}
> 
> The count of `100` gets inferred now and the new counts are for the split edges as expected. The change that causes the `INDIRECTGOTO_IRR_LOOP` to go from 400->399 is that the probes shifted so that edge 21 and edge 22 on RHS flipped compared to LHS. That's not a big deal though.
> 
> 
Thanks!


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D120096



More information about the llvm-commits mailing list