[llvm-commits] [llvm] r123105 - in /llvm/trunk: lib/Analysis/ScalarEvolution.cpp test/Analysis/ScalarEvolution/nsw.ll

Chris Lattner sabre at nondot.org
Sun Jan 9 23:39:33 PST 2011


On Jan 9, 2011, at 6:36 PM, Nick Lewycky wrote:

> Chris Lattner wrote:
>> Author: lattner
>> Date: Sat Jan  8 20:28:48 2011
>> New Revision: 123105
>> 
>> URL: http://llvm.org/viewvc/llvm-project?rev=123105&view=rev
>> Log:
>> teach SCEV analysis of PHI nodes that PHI recurences formed
>> with GEP instructions are always NUW, because PHIs cannot wrap
>> the end of the address space.
> 
> Aren't GEPs also NSW? I tried looking this up in the LangRef but wasn't able to find it, but I've been coding under the impression that GEPs are both nuw and nsw.

As Frits points out, on some architectures it is safe to assume that.  However, since it isn't needed to prove any properties that I'm aware, it is not worth making it target parameterized.

-Chris



More information about the llvm-commits mailing list