[PATCH] D28593: Update loop branch_weight metadata after loop rotation.

Michael Kuperstein via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 12 09:26:58 PST 2017


I haven't looked at the patch yet, (and I'm also not at the office), but:

1) The new probabilities should be the opposite of the last example Dehao
had. That is, the external if should be 1/7, and the one on the backedge
7/28.

2) I think this is just conditional probability - cond hasn't changed, but
P(cond | cond has been true once) is lower than P(cond). This exactly
corresponds to lowering the number of expected iterations by 1, given that
we know we already executed one iteration.


On Jan 12, 2017 09:21, "Xin Tong via Phabricator" <reviews at reviews.llvm.org>
wrote:

trentxintong added a comment.

@danielcdh Its the true the cond is not changed, but the inputs to the
condition has changed, before you were testing with index variable in the
loop header, now u have 2 conditions and the SSA values you use in the
conditions have changed, so the probability needs to be adjusted. I will
explain more when i get to office.


https://reviews.llvm.org/D28593
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170112/6ec7dee9/attachment.html>


More information about the llvm-commits mailing list