[LLVMdev] instruction combiner patch

Nick Lewycky nicholas at mxc.ca
Wed Jun 7 05:44:00 PDT 2006


Andrew Lenharth wrote:
> What would it do for:
> 
> struct foo {
>  int x;
>  int y[0];
> };
> ...
> struct foo* f = ...;
> f->y[10];
> 
> This type of things is quite common and making it undef will break
> things.  I don't think the undef part can work safely.

It works fine. Constant folding of loads only applies to cases where the
array is a known constant at compile time, so no transformation is done
here.

Nick



More information about the llvm-dev mailing list