[PATCH] D64235: [Loop Peeling] Fix the handling of branch weights of peeled off branches

Serguei Katkov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 17 21:48:36 PDT 2019


skatkov planned changes to this revision.
skatkov marked an inline comment as done.
skatkov added a comment.

Hi Philip, Thank you for review. I'll update a patch.



================
Comment at: llvm/test/Transforms/LoopUnroll/peel-loop-pgo-deopt.ll:76
 !17 = !{!"branch_weights", i32 1, i32 0}
 
+;CHECK: !16 = !{!"branch_weights", i32 3001, i32 1001}
----------------
reames wrote:
> If I'm reading this test correctly, the result is not making sense.
> 
> We have a loop (for.body) with a side exit branch frequency of 100% (%17) and a latch frequency of ~3 (%16).  
> 
> If we peel this twice, we should still have a very rarely taken side exit, but the frequencies appear to be saving that's more common in the peeled copy?  (The test naming is hard to follow, so I might just be reading the test wrong.)
All this weights are about latch. Weight of side-exit remains untouched, so should be the same (1,0).

I'll update the test to make it visible.


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

https://reviews.llvm.org/D64235





More information about the llvm-commits mailing list