On Tue, Jun 10, 2014 at 11:22 AM, Zhenqiang Chen wrote: > Hi, > > For loop2-invariant pass, when flag_ira_loop_pressure is enabled, > function gain_for_invariant checks the pressures of all register > classes. This does not make sense since one invariant might impact > only one register class. > > The patch enhances functions get_inv_cost and gain_for_invariant to > check only the register pressure of the invariant if possible.
This patch may work for targets with more-or-less orthogonal reg classes, but not if there is a lot of overlap between reg classes. So I don't think this approach is OK. Ciao! Steven