search for: ptr_inb

Displaying 4 results from an estimated 4 matches for "ptr_inb".

2020 Feb 18
8
The semantics of nonnull attribute
...uldn't be null. However, this transformation is incorrect if f(nonnull null) is equivalent to f(poison). If f was an empty function, f(nonnull null) never raises UB regardless of ptr. So we can't guarantee ptr != null at other uses of ptr. 2. InstCombine (https://godbolt.org/z/HDQ7rD ): %ptr_inb = gep inbounds %any_ptr, 1 f(%ptr_inb) => %ptr_inb = .. (identical) f(nonnull %ptr_inb) This optimization is incorrect if `f(nonnull null)` is UB. The reason is as follows. If `gep inbounds %any_ptr, 1` yields poison, the source is `f(poison)` whereas the optimized one is `f(nonnull poison)`. `...
2020 Feb 18
2
The semantics of nonnull attribute
...ll at other uses of ptr. For the given code snipped it is not even invalid to propagate nonnull in the poison case but your point is not wrong, if we have f(poison) we cannot derive anything from it if the argument might be unused. > 2. InstCombine (https://godbolt.org/z/HDQ7rD ): > > %ptr_inb = gep inbounds %any_ptr, 1 > f(%ptr_inb) > => > %ptr_inb = .. (identical) > f(nonnull %ptr_inb) > > This optimization is incorrect if `f(nonnull null)` is UB. The reason is as > follows. > If `gep inbounds %any_ptr, 1` yields poison, the source is `f(poison)` > wherea...
2020 Feb 18
3
The semantics of nonnull attribute
...en code snipped it is not even invalid to propagate nonnull > in the poison case but your point is not wrong, if we have f(poison) > we cannot derive anything from it if the argument might be unused. > > > > 2. InstCombine (https://godbolt.org/z/HDQ7rD ): > > > > %ptr_inb = gep inbounds %any_ptr, 1 > > f(%ptr_inb) > > => > > %ptr_inb = .. (identical) > > f(nonnull %ptr_inb) > > > > This optimization is incorrect if `f(nonnull null)` is UB. The > > reason is as follows. > > If `gep inbounds %any_ptr, 1` yields pois...
2020 Feb 18
8
The semantics of nonnull attribute
...invalid to propagate nonnull > > in the poison case but your point is not wrong, if we have f(poison) > > we cannot derive anything from it if the argument might be unused. > > > > > > > 2. InstCombine (https://godbolt.org/z/HDQ7rD ): > > > > > > %ptr_inb = gep inbounds %any_ptr, 1 > > > f(%ptr_inb) > > > => > > > %ptr_inb = .. (identical) > > > f(nonnull %ptr_inb) > > > > > > This optimization is incorrect if `f(nonnull null)` is UB. The > > > reason is as follows. > > > If...