2011/1/7 Chung-Lin Tang <clt...@codesourcery.com>: > I analyzed this testcase regression a while earlier; the direct cause of > this is due to mips_order_regs_for_local_alloc(), which now serves as > MIPS' ADJUST_REG_ALLOC_ORDER macro. > > The mips_order_regs_for_local_alloc() function seems to be written for > the old local-alloc.c, still left as the deprecated > ORDER_REGS_FOR_LOCAL_ALLOC macro after the transition to IRA (actually > not called at all during then), and relatively recently 'revived' after > a patch by Bernd that created the ADJUST_REG_ALLOC_ORDER macro went in. > > So you have a local-alloc.c heuristic working in IRA, which seemed to > cause these regressions. > > Removing mips_order_regs_for_local_alloc() will let this testcase pass; > of course the real fix should be to review the MIPS reg-ordering logic, > left for you MIPS people... > > Chung-Lin >
As I can see, mips_order_regs_for_local_alloc() is only used to reorder $24 (T_REG) for MIPS16. Since current definition of REG_ALLOC_ORDER for IRA is not {0,1,2,...} any more, the old loop code, for (i = 0; i < FIRST_PSEUDO_REGISTER; i++) reg_alloc_order[i] = i; in mips_order_regs_for_local_alloc() seems inadequate. Because this will override the definition of REG_ALLOC_ORDER. Anyway, when I tried to rewrite the function to keep the register order, the testcase is passed, but I can't see the speedup on my port. Thanks, Mingjie