IPA mod/ref analysis
- GCC currently performs no real interprocedural analysis of call clobbering of variables, except for static variables. That analysis is restricted in that it requires the statics to be alias free (IE cannot be involved in aliasing relationships at all). The local intraprocedural analysis that *is* performed for everything else has to make a very large number of conservative assumptions that cause it to give very bad results in most cases. This work aims to fix that by performing an interprocedural mod/ref computation that handles both aliases, and local variables. This will enable us to give better results to call clobbering, enabling us to keep values in registers over calls, and eliminate loads and stores that cross unaffected calls.
Personnel
- Daniel Berlin
Delivery Date
- This optimization will be ready by 2006-10-15.
Benefits
- GCC will generate better code in the presence of calls.
Dependencies
- None
Modifications Required
- An IPA phase that performs the interprocedural computation is added. Because it requires points-to info, the initial implementation is actually not based on the traditional method of "solve mod/ref, then add in alias info", but instead, computes mod/ref at the same time as the alias analysis, using a constraint formulation. In addition, the current implementation has roughly 2000 lines of code that was copied from tree-ssa-structalias.c, to do the constraint solving. This is mainly because prototyping was easier this way. I will remerge the two pieces in stage2 of 4.3.