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

Sanjoy Das via llvm-dev llvm-dev at lists.llvm.org
Wed Oct 19 12:38:45 PDT 2016


Hi Alexandre,

On Wed, Oct 19, 2016 at 11:19 AM, Alexandre Isoard
<alexandre.isoard at gmail.com> wrote:
> I am probably missing something important, but what I mean is that you can
> always convert:
>
> %y = xor %x, %x
> to
> %y = 0
>
> Regardless of if %x is/might be an undef. That is, consider that reading %x
> any number of times always give the value of its definition (as SSA
> suggest). Therefore, disregarding the special semantic of undef (which is
> always safe in this direction).
>
> Is there an example of transformation which is forbidden by the fact that a
> variable might be undef?

There are some examples earlier in this thread, but this is one:
http://www.playingwithpointers.com/problem-with-undef.html

(Writing the blog post is already paying off :) )

-- Sanjoy


More information about the llvm-dev mailing list