On Wed, Jun 24, 2015 at 10:25:46AM +0930, Alan Modra wrote: > @@ -30720,14 +30721,20 @@ rs6000_rtx_costs (rtx x, machine_mode mode, int > outer_code, > - (outer_code == SET ? 1 : 0)); > return true; > > - case CONST: > - case HIGH: > - case SYMBOL_REF: > case MEM: > /* When optimizing for size, MEM should be slightly more expensive > than generating address, e.g., (plus (reg) (const)). > L1 cache latency is about two instructions. */ > *total = !speed ? COSTS_N_INSNS (1) + 1 : COSTS_N_INSNS (2); > + *total += COSTS_N_INSNS (rs6000_address_cost (XEXP (x, 0), mode, > + 0, speed));
So the unit of address cost is whole insns? Eww. > + return true; > + > + case CONST: > + case HIGH: > + case LO_SUM: > + case SYMBOL_REF: > + *total = COSTS_N_INSNS (1); > return true; Why is the cost of CONST only one insn? Shouldn't you take the (address) cost of whatever is inside it? Segher