[llvm-dev] RFC: Killing undef and spreading poison

Peter Lawrence via llvm-dev llvm-dev at lists.llvm.org
Thu Jun 8 12:29:13 PDT 2017

            in your blog post  https://www.playingwithpointers.com/problem-with-undef.html <https://www.playingwithpointers.com/problem-with-undef.html>
you describe a problem with LLVM “undef”,
yet in your paper http://www.cs.utah.edu/~regehr/papers/undef-pldi17.pdf <http://www.cs.utah.edu/~regehr/papers/undef-pldi17.pdf>
you do not suggest fixing this problem, even though in chpt. 9 you identify other
compilers that do attempt to avoid it.

It seems to me that since transforming a program with multiple uses of an “undef” variable
into one with multiple distinct “undef”s results in behavior that is inconsistent (and that
violates users expectations) we should not allow it.

This seems to me to be one of those situations where the phrase “extraordinary claims
require extraordinary evidence” applies, and I’m not seeing any, are you ?

IIUC, a “freeze” operation can always be inserted over an “undef” (now “poison”)
that forces a single consistent value, but why the extra overhead of “freeze”, as
there doesn’t seem to be a convincing argument for ever allowing the same variable
to have inconsistent values, or am I missing something ?

Peter Lawrence.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170608/14b5cb27/attachment.html>

More information about the llvm-dev mailing list