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

Sanjoy Das via llvm-dev llvm-dev at lists.llvm.org
Thu Oct 20 14:05:57 PDT 2016


Hi Krzysztof,

Krzysztof Parzyszek wrote:
> In both of these cases, the expression tree in the IR is going to look like
> == (freeze(%x), freeze(%x))
>
> The %a and %b are just labels on values, which are defined in the exact
> same way. How do you differentiate these two?

freeze is an llvm::Instruction.  You'd differentiate them the same way 
you'd differentiate

   %a = load i32, i32* @global
   call void @foo()
   %b = load i32, i32* @global
   print(%a == %b)

from

   %a = load i32, i32* @global
   %b = %a ;; alias these somehow
   call void @foo()
   print(%a == %b)



freeze won't be a operator, so you won't have a FreezeConstantExpr etc.

> If %a = freeze(%x), is %a+1 == %a+1?

Yes.

-- Sanjoy


More information about the llvm-dev mailing list