[PATCH] D71799: [Attributor] AAUndefinedBehavior: Check for branches on undef value.

Stefanos Baziotis via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 24 01:30:31 PST 2019


baziotis added a comment.

> In D71799#1794768 <https://reviews.llvm.org/D71799#1794768>, @uenoku wrote:
> 
>> In D71799#1794762 <https://reviews.llvm.org/D71799#1794762>, @baziotis wrote:
>>
>> > I see the message. Sorry btw that I don't know exactly how `AAValueSimplify` works. When I started this patch, I assumed it was in everyone's best interest
>> >  to not spend time in it right now, so I'm guessing from looking small pieces of its code.
>>
>>
>> Sorry for my lack of words. I thought you were talking about in `updateImpl`. I think it can't happen **in updates** but can happen once reaches to a fix point.
> 
> 
> FWIW, I think @uenoku comment is correct here but it might help to elaborate:
> 
> The way `AAValueSimplify` is build ensures that only once a fixpoint is reached the simplified value is "known". One could also say, once a simplified value is known we know a fixpoint had to be reached.
>  Now the interesting part here is that this means a fixpoint for the `AAValueSimplify` object. The Attributor will determine fixpoints for attributes eagerly, thus even if others are not there yet and still iterating. It will even inform them (via `indicateOptimisticFixpoint`) that they reached a fixpoint and can use the assumed value as known from now on. That is why you can see the "odd behavior" in a different objects `updateImpl`.

Yes, thanks, it helped (also @uenoku helped a lot). But I still don't get why the following happens:

> 2. For some reason, for branches where undef is actually written (i.e. br i1 undef, ...), the AAValueSimplify doesn't tell us it is known. Thus, before we even start querying AAValueSimplify, we check the standard LLVM Value if it is undef.

It seems to me that for constants or `undef`, this should be known. Looking at `initialize()` of `AAValueSimplifyFloating`, for constants and `undef`, it indicates a //pessimistic// fixpoint and I don't understand why.


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

https://reviews.llvm.org/D71799





More information about the llvm-commits mailing list