[PATCH] D90529: Allow nonnull/align attribute to accept poison

Johannes Doerfert via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 1 18:34:10 PST 2021


jdoerfert added a comment.

In D90529#2596221 <https://reviews.llvm.org/D90529#2596221>, @aqjune wrote:

>> If the attribute holds for the value in the scope, CSE is free to change val to val2 because the attributes did already conflict even if you used val and val2.
>> Do you see a problem when the attribute is scope based?
>
> Before diving into further discussion, let's clarify my understanding about the semantics that you want:
>
> - Calling `f(nonnull null, noundef null)` is equivalent to `f(nonnull noundef null, nonnull noundef null)` because an attribute applies to all 'equivalent' values in the arguments. Is my understanding correct?
> - Similarly, calling `f(nonnull null, null)` is equivalent to `f(poison, poison)`?
> - What about `f(nonnull poison, null)`? Since poison can be folded into any value, we can make it `f(nonnull null, null)`, which is again `f(poison, poison)`.

You need to start with the same value for this to make sense (to me), so these are what I want:

- `f(nonnull %p, noundef %p)` is equivalent to `f(nonnull noundef %p, nonnull noundef %p)`
- `%p = %q; f(nonnull %p, noundef %q)` is equivalent to `f(nonnull noundef %p, nonnull noundef %q)`
- `%p = null; f(nonnull %p, %p)` is equivalent to `f(poison, poison)`

I don't understand how the values were set up in the last example.

>> [...]
>
> I don't understand this sentence, I thought we could see all the call sites and assume that it was the only call of hi1.

My bad, I forgot we are still assuming this and therefore I interpreted your suggested to scrub the call site in a general setting (which doesn't work).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D90529



More information about the llvm-commits mailing list