[LLVMdev] RFC: Proposal for Poison Semantics

Sanjoy Das sanjoy at playingwithpointers.com
Tue Jan 27 21:11:48 PST 2015


> Now if we do the usual transform of "zext (add nuw X Y)" => "add nuw
> (zext X) (zext Y)" then we get
>
>   %m.wide = zext i32 %m to i64
>   %n.wide = zext i32 %n to i64
>   %z = add nuw i64 %m.wide, %n.wide
>   %s = lshr i64 %y, 32
>   %addr = gep %some_global, %s
>   store i32 42, i32* %addr

I made a typo here: the lshr should be "%s = lshr i64 %z, 32".  Its
value will be 1 for %m = %n = 2^32-1, and the transformed program will
store 42 to &(%some_global)[1].

-- Sanjoy



More information about the llvm-dev mailing list