[llvm-commits] [llvm] r92411 - in /llvm/trunk: lib/Transforms/Scalar/InstructionCombining.cpp test/Transforms/InstCombine/load-cmp.ll

Bill Wendling wendling at apple.com
Mon Jan 4 09:39:20 PST 2010


On Jan 3, 2010, at 11:40 PM, Duncan Sands wrote:

> Hi Chris,
> 
>> if ("foobar"[i] == '\0') ...
>> 
>> which we compile into: if (i == 6), saving a load and 
>> materialization of the global address.  This also exposes 
>> loop trip count information to later passes in many cases.
> 
> nice transform.  However if this is not an inbounds GEP and the index "i" is
> 64 bits on a 32 bit machine, then there are other possible values for "i",
> such as i == 6 + 2^32.
> 
At least in C, accessing outside of an array is undefined. Isn't this a case of "they get what they deserve"? :-)

-bw





More information about the llvm-commits mailing list