Jochen Wilhelmy
2011-May-17 20:54 UTC
[LLVMdev] which pass for optimizing access to a global struct?
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
Duncan Sands
2011-May-18 06:04 UTC
[LLVMdev] which pass for optimizing access to a global struct?
Hi Jochen,> 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; > }the global value numbering (gvn) pass can do this, as can the instruction combiner (-instcombine). Maybe there are some others too. Ciao, Duncan.> > I guess it's one of the alias passes but which one to choose? > Thanks, > -Jochen > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev