search for: hdq7rd

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

2020 Feb 18
8
The semantics of nonnull attribute
..., so ptr shouldn'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(nonnul...
2020 Feb 18
2
The semantics of nonnull attribute
...;t guarantee ptr != null 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...
2020 Feb 18
3
The semantics of nonnull attribute
...s 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...
2020 Feb 18
8
The semantics of nonnull attribute
...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 > > &gt...