[PATCH] Infer known bits from dominating conditions

Daniel Berlin dberlin at dberlin.org
Mon Mar 30 09:20:43 PDT 2015


At some point, that seems really expensive to do.
BasicAA was meant to be a simple, stateless AA.
It already does a lot of walking, and it gets expensive in those cases
because it doesn't cache it.  It just has random cutoffs to try to make it
cheap, but it doesn't always.
(I have profiles to prove it :P)
IMHO, Rather than shove more stuff *in* it, we should be slowly moving
walking stuff out into some pass that is stateful, caching, and know when
we invalidate it.  Then we can do expensive stuff in that pass.

Otherwise, what happens is someone says "hey, if only we increase this
number to 7 instead of 5, we get this little case i have over here" (which
you can make arbitrary), or more generally, "hey, if we only also
calculated for this stateful piece of info, we get this little case over
here"


On Mon, Mar 30, 2015 at 8:48 AM, James Molloy <james at jamesmolloy.co.uk>
wrote:

> Hi Philip,
>
> Slightly late to the party here, but I think this work might help fix
> PR23067.
>
> In PR23067, BasicAA needs to know if a value is known non-zero or not. In
> the example code, the value is known non-zero by virtue of the dominating
> condition. However, IsKnownNonZero just calls calculateKnownBits. Your
> dominance stuff will be able to know that all bits cannot be zero, but that
> information is lost because any bit could be set or unset.
>
> Is there a plan, or what would be the easiest way, of extending your
> change so that isKnownNonZero would get the right information from a
> dominating condition?
>
> Cheers,
>
> James
>
> On Tue, 10 Mar 2015 at 23:17 Philip Reames <listmail at philipreames.com>
> wrote:
>
>> REPOSITORY
>>   rL LLVM
>>
>> http://reviews.llvm.org/D7708
>>
>> Files:
>>   llvm/trunk/lib/Analysis/ValueTracking.cpp
>>   llvm/trunk/test/Transforms/InstCombine/dom-conditions.ll
>>
>> EMAIL PREFERENCES
>>   http://reviews.llvm.org/settings/panel/emailpreferences/
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150330/a54db2ff/attachment.html>


More information about the llvm-commits mailing list