Krzysztof Parzyszek via llvm-dev
2019-Feb-25 19:30 UTC
[llvm-dev] funnel shift, select, and poison
On 2/25/2019 1:24 PM, John Regehr via llvm-dev wrote:> > This is a sound transformation only if foo() returns poison when it is > called with poison as an argument.Then how do you interpret "poison has to propagate through calls"? A typical analysis of a function will either see a call or the inlined body. If "call(poison)" cannot be assumed to be a poison, then a call effectively stops the propagation of a poison. -Krzysztof
John Regehr via llvm-dev
2019-Feb-25 19:35 UTC
[llvm-dev] funnel shift, select, and poison
> A typical analysis of a function will either see a call or the inlined > body. If "call(poison)" cannot be assumed to be a poison, then a call > effectively stops the propagation of a poison.Sorry that I was unclear. What I am trying to say is that calls and returns (like loads and stores) are transparent with respect to poison. It is definitely unsound to assume call(poison) == poison, because not every function returns a value that is poison-dependent on the function's arguments. John
Krzysztof Parzyszek via llvm-dev
2019-Feb-25 19:44 UTC
[llvm-dev] funnel shift, select, and poison
On 2/25/2019 1:35 PM, John Regehr via llvm-dev wrote:> It is definitely unsound to assume call(poison) == poison, because not > every function returns a value that is poison-dependent on the > function's arguments.That's exactly the same as for a "select". I'm in favor of a set of simple rules regarding the propagation of poison, so I lean towards the "one answer" you proposed in the first email, i.e. > One answer might be "only select and phi stop poison" except augmented to include calls and invokes. -Krzysztof