[llvm-dev] Dataflow analysis regression in 3.7

Chad Rosier via llvm-dev llvm-dev at lists.llvm.org
Sun Jul 9 08:57:10 PDT 2017



On 7/7/2017 4:59 PM, Davide Italiano wrote:
> On Fri, Jul 7, 2017 at 1:47 PM, Chad Rosier <mcrosier at codeaurora.org> wrote:
>> David/Johan,
>>
>> I would love to claim victory, but I don't think that D34901 catches this
>> case.
>>
> Hi Chad, thanks for taking another look at this.
> Maybe I didn't bisect correctly. Apologies. Anyway, more fun for us.
Yes, indeed.  More fun!
>> However, I got interested and threw this together quickly:
>> https://reviews.llvm.org/D35140.
>>
>> This does catch the below case.  If people are interested I can add test
>> cases and submit for formal review.  FWIW, it does hit about 1/3 of all of
>> the SPEC benchmarks.  I haven't done any performance analysis to see if it
>> matters, however.
>>
> As I stated earlier, I think this calls for a slightly better VRP
> [and/or improvements in VRP] & I'm not entirely sure `InstCombine` is
> the best place for this transform.
I tend to agree that InstCombine doesn't feel like the right places for 
this transformation, hence the reason I didn't post for formal review.

> OTOH, the fact this triggers a lot is a good thing, if your WIP patch
> actually results in performance improvements, we should consider a
> more general solution to address this kind of issues.
Matt Simpson and I briefly discussed this transformation.  One of his 
suggestions was to add a pass in the pipeline where the dominator tree 
was available (note my patch used a poor man's version of domination) 
and to add range meta-data to values (or replace values if we know the 
exact value) based on dominating conditions.  I thought it was pretty 
interesting idea, but I'm not very familiar with how range metadata is 
generated and used.

> --
> Davide



More information about the llvm-dev mailing list