[LLVMdev] which pass for optimizing access to a global struct?

Jochen Wilhelmy j.wilhelmy at arcor.de
Tue May 17 13:54:21 PDT 2011


Hi!

which pass do you recommend to optimize access to a global
struct? for example:

struct
{
int a;
int b;
} global;

void foo(int x)
{
     global.a = x;
     int y = global.a; // should be replaced by int y = x;
}

I guess it's one of the alias passes but which one to choose?
Thanks,
-Jochen




More information about the llvm-dev mailing list