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

Stefanos Baziotis via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Dec 22 08:07:11 PST 2019


baziotis added a comment.

>   SimplifiedV = ...;
>   if (!SimplifiedV.hasValue())
>     ... // Do nothing for now, no value yet.
>   else {
>     Val = SimplifiedV.getValue();
>     if (Val is undef)
>       UBInsts.insert;
>     else
>       NoUBInsts.insert;
>   }

Note that while this is what makes sense to me, Johannes told me that if `SimplifiedV` gives `None` (i.e. it doesn't have value), then we can assume
that it is `undef` but I don't know why this is true.

Edit: Just saw your comment, which you seem to not assume that.
In your code, why insert it in `UBInsts` and then remove it? Since we query `AAValueSimplify`, isn't that going to call us again and thus at some point get the value (which in turn means we don't insert it and just wait for when we'll be called again).


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

https://reviews.llvm.org/D71799





More information about the llvm-commits mailing list