[LLVMdev] The nsw story

Dan Gohman gohman at apple.com
Mon Dec 5 14:22:09 PST 2011


On Dec 5, 2011, at 11:55 AM, Paul Robinson wrote:
> 
> On Thu, Dec 1, 2011 at 9:37 AM, David A. Greene <greened at obbligato.org> wrote:
> Dan Gohman <gohman at apple.com> writes:
> 
> > Prohibiting poison values from propogating through memory would mean
> > that the reg2mem pass would no longer be a semantics-preserving pass.
> 
> Or it means you couldn't demote those values.
> 
> If reg2mem is constructing spill slots, or address-not-taken locals, I could
> see classifying those as okay-to-poison. You would not want statics or globals
> or pointer-addressed memory to be poisonable, as those should be treated
> as being observable locations.
> 
> So, it's not really "all of memory" that could be poisoned, only these
> compiler-generated things.

This would mean that it's not valid to do store-to-load propagation
in the optimizer if the pointee might be a global variable. That
would mean the loss of real optimizations.

And it would still mean that non-volatile store instructions suddenly
can have side effects beyond just writing to their addressed memory.
That would be surprising.

I think Dave also suggested making select instructions be
observation points. That would mean that select instructions would
have side effects. Again, that would be surprising.

Dan




More information about the llvm-dev mailing list