[llvm-dev] Killing undef and spreading poison

Chandler Carruth via llvm-dev llvm-dev at lists.llvm.org
Wed Oct 19 03:33:31 PDT 2016


On Tue, Oct 18, 2016 at 3:46 PM Hubert Tong via llvm-dev <
llvm-dev at lists.llvm.org> wrote:

> Can IR (with/without your proposal) differentiate between C's "trap
> representations" and "unspecified values"?
>

Poison, with and without this proposal, is a good model for C's "trap
representations" IMO. If there is a discrepancy there, I would be surprised
and suspect an error somewhere.

Without the proposal, an "unspecified value" is hard or impossible to
produce in LLVM. Best idea I have is a volatile store of undef followed by
a load. The problem is precisely what "freeze" in the proposal fixes -- we
need some way to pick a *single* unspecified value. So with the proposal
"freeze(poison)" will produce an unspecified value.

-Chandler
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20161019/ac4dddca/attachment.html>


More information about the llvm-dev mailing list