We have modified following existing optimizers to use profile feedback:
- register referencing
- Register referencing pass decides what register class the given pseudo register should
be allocated in. This is done by combining preferences of all instructions mentioning the given
register. We now weight the preferences by expected frequencies of basic blocks.
- register allocation
- GCC register allocator simply assigns each pseudo register a priority and then
allocates registers to pseudo registers in the priority order giving each pseudo register the first register
available in its preferred class and then the first available register in the
alternate class if it did not succeed in the preferred class.
We have modified the code to compute pseudo register priority to use frequencies instead
of simple loop depth heuristics and have important success with this change
speeding up the resulting code by about 0.6%.
- final pass
- Final pass outputs code alignment recommended for function body by target
machine description. We omit the alignment, where allowed, for functions not
executed in the training run when profile feedback is available.
- register-stack conversion
- Register stack conversion pass has property that it always produces code
optimal only for one entry path to each basic block. We have modified its
traversal to take into account frequencies in order to optimize the most
frequent paths.
Jan Hubicka
2003-05-04