[PATCH] D10979: Update the branch weight metadata in JumpThreading pass.

Cong Hou congh at google.com
Tue Jul 21 13:58:25 PDT 2015


On Tue, Jul 21, 2015 at 1:10 PM, Xinliang David Li <davidxl at google.com> wrote:
> On Tue, Jul 21, 2015 at 1:03 PM, Cong Hou <congh at google.com> wrote:
>> congh added a comment.
>>
>> In http://reviews.llvm.org/D10979#208776, @davidxl wrote:
>>
>>> I suggest also adding another test case (documented in the PR -- the one that has problem with jump-threading + loop-rotation + jump-threading).
>>>
>>> This reminds me of a way to do profile sanity check/validation when debug check is turned on:
>>>
>>> 1. compute the BB freq before the pass
>>> 2. cfg transformation + BB freq update
>>> 3. branch probability weight update
>>> 4. recompute BFI using updated weight in 3). The result of 4) should match that of 2).
>>
>>
>> You mean comparing result from 4) and 1)? What if a CFG node is split? If CFG is modified, we may not be able to find one-to-one BB match.
>
> I mean 4) vs 2) (the BB freq after incremental update). 2)+3) may
> introduce bugs such that 4) won't compare equivalent with 2).

OK, this is a good idea. Here I am afraid of some precision issues. We
could not expect the exactly identical frequency numbers. But this can
be solved by approximate equality comparison. Let me add this check in
a patch update (or a separate patch?).

Cong

>
>>To make a reasonable comparison, we may need to understand what the pass does...
>
> yes. This will help that too. Suppose the pass does not do any of 2)
> but does change the CFG, then comparison of 4) vs 1) will certainly
> fail.
>
>>
>>
>> http://reviews.llvm.org/D10979
>>
>>
>>



More information about the llvm-commits mailing list