[LLVMdev] inttoptr weirdness

Chris Lattner clattner at apple.com
Mon Dec 14 16:55:29 PST 2009

On Dec 14, 2009, at 4:09 PM, Dale Johannesen wrote:

>> single threaded programs.  We do try to conform to the C++'0x memory
>> model by not introducing memory accesses where they did not exist
>> before, but deleting non-volatile accesses is always fine.
> That's true, but it's often hard to figure out a store to a global  
> can be deleted, as a use may be arbitrarily far away, in a different  
> file for example.

Sure, the compiler can only remove it if it can see the redefinition.   
In practice, stores are only deleted when they are undefined behavior  
(e.g. the target is read only) or if it sees a subsequent store to the  
same location (with no uses between them).


More information about the llvm-dev mailing list