[LLVMdev] BasicAliasAnalysis and out-of-bound GEP indices
resistor at mac.com
Thu Nov 15 12:41:11 PST 2007
On Nov 15, 2007, at 2:17 PM, Wojciech Matyjewicz wrote:
> BasicAA is correct for in this case, as it seems to treat
> conservatively any indexing of a variable-sized array.
Right, that's the key distinction. For a VLA, you don't know where it
might end (without more complex reasoning), so you can't assume that a
given GEP is undefined. However, for arrays with declared length, it
is easy to tell when you're doing something undefined by GEPing past
the end. This latter case is the optimization opportunity.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 2555 bytes
Desc: not available
More information about the llvm-dev