[LLVMdev] Proposal for Poison Semantics

Sanjoy Das sanjoy at playingwithpointers.com
Wed Feb 4 10:27:24 PST 2015


> But we could have a simple precondition that states that this transformation is correct if %A is not any operations with nsw/nuw/exact flags. Sure, it's not as good as the situation we have today, but the current situation doesn't look very good anyway :)

Function arguments can be poison too.  One way to get around this is
to declare that calling a function with poison as an argument is UB,
but then outlining functions without introducing UB becomes tricky.  A
similar issue exists with loading poison -- if we make storing poison
UB period, then reg2mem will introduce UB.

>
> I have a question though: When does poison becomes UB? On external calls and volatile stores only?  Any other visible side-effecting operations?  (at least those two have to be UB, right?)
>
> Nuno
>




More information about the llvm-dev mailing list