Krzysztof Parzyszek via llvm-dev
2019-Feb-25 17:29 UTC
[llvm-dev] funnel shift, select, and poison
On 2/25/2019 11:15 AM, John Regehr via llvm-dev wrote:> I'd just like to add that the general question here is "where does > poison stop propagating" and this question needs to be definitively > answered by this community.Does a call stop poison? Whatever the decision is may be contradicted after inlining, so what should such a call return? A superposition of poison and non-poison, until the function is inlined? It's a serious question. -Krzysztof
John Regehr via llvm-dev
2019-Feb-25 18:28 UTC
[llvm-dev] funnel shift, select, and poison
Poison has to propagate through calls and loads/stores, or else basically nothing works. John On 2/25/19 10:29 AM, Krzysztof Parzyszek via llvm-dev wrote:> On 2/25/2019 11:15 AM, John Regehr via llvm-dev wrote: >> I'd just like to add that the general question here is "where does >> poison stop propagating" and this question needs to be definitively >> answered by this community. > > Does a call stop poison? > > Whatever the decision is may be contradicted after inlining, so what > should such a call return? A superposition of poison and non-poison, > until the function is inlined? It's a serious question. > > -Krzysztof > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
Krzysztof Parzyszek via llvm-dev
2019-Feb-25 18:42 UTC
[llvm-dev] funnel shift, select, and poison
On 2/25/2019 12:28 PM, John Regehr via llvm-dev wrote:> Poison has to propagate through calls and loads/stores, or else > basically nothing works.Consider this: %v0 = call i32 @foo(poison) nounwind/readnone store i32 %v0, i32* %valid_address If we assume that poison propagates through calls, we could then optimize this to %v0 = poison store poison, i32* %valid_address If we somehow realized that foo is define i32 @foo(i32) { ret i32 0 } then the resulting code would be different. -Krzysztof