Fro Nov 19 05:48:45 CET 1999 Jan Hubicka <hubicka@freesoft.cz>
+ * regclass.c (may_move_in_cost): Rename from may_move_cost, all
+ references updated.
+ (may_move_out_cost): New variable.
+ (init_reg_sets_1): Initialize may_move_out_cost.
+ (record_reg_classes): Use may_move_out_cost.
+
* regclass.c (dump_regclass): New function.
(regclass): New parameter DUMP, call DUMP_REGCLASS.
- * toplev.c (rest_of_compilation): Opent lreg dump file before regclass,
+ * toplev.c (rest_of_compilation): Open lreg dump file before regclass,
pass rtl_dump_file to regclass.
* rtl.h (regclass): Update prototype.
/* Similar, but here we don't have to move if the first index is a subset
of the second so in that case the cost is zero. */
-static int may_move_cost[N_REG_CLASSES][N_REG_CLASSES];
+static int may_move_in_cost[N_REG_CLASSES][N_REG_CLASSES];
+
+/* Similar, but here we don't have to move if the first index is a superset
+ of the second so in that case the cost is zero. */
+
+static int may_move_out_cost[N_REG_CLASSES][N_REG_CLASSES];
#ifdef FORBIDDEN_INC_DEC_CLASSES
move_cost[i][j] = cost;
if (reg_class_subset_p (i, j))
- cost = 0;
+ may_move_in_cost[i][j] = 0;
+ else
+ may_move_in_cost[i][j] = cost;
- may_move_cost[i][j] = cost;
+ if (reg_class_subset_p (j, i))
+ may_move_out_cost[i][j] = 0;
+ else
+ may_move_out_cost[i][j] = cost;
}
}
for (class = 0; class < N_REG_CLASSES; class++)
pp->cost[class]
= (recog_data.operand_type[i] == OP_IN
- ? may_move_cost[class][(int) classes[i]]
- : may_move_cost[(int) classes[i]][class]);
+ ? may_move_in_cost[class][(int) classes[i]]
+ : may_move_out_cost[(int) classes[i]][class]);
/* If the alternative actually allows memory, make things
a bit cheaper since we won't need an extra insn to
if (prefclass)
alt_cost
- += (may_move_cost[(unsigned char) prefclass[REGNO (op)]]
+ += (may_move_in_cost[(unsigned char) prefclass[REGNO (op)]]
[(int) classes[i]]);
if (REGNO (ops[i]) != REGNO (ops[j])
for (class = 0; class < N_REG_CLASSES; class++)
pp->cost[class]
= (recog_data.operand_type[i] == OP_IN
- ? may_move_cost[class][(int) classes[i]]
- : may_move_cost[(int) classes[i]][class]);
+ ? may_move_in_cost[class][(int) classes[i]]
+ : may_move_out_cost[(int) classes[i]][class]);
/* If the alternative actually allows memory, make things
a bit cheaper since we won't need an extra insn to
if (prefclass)
alt_cost
- += (may_move_cost[(unsigned char) prefclass[REGNO (op)]]
+ += (may_move_in_cost[(unsigned char) prefclass[REGNO (op)]]
[(int) classes[i]]);
}
}
pp->mem_cost += (MEMORY_MOVE_COST (Pmode, class, 1) * scale) / 2;
for (i = 0; i < N_REG_CLASSES; i++)
- pp->cost[i] += (may_move_cost[i][(int) class] * scale) / 2;
+ pp->cost[i] += (may_move_in_cost[i][(int) class] * scale) / 2;
}
break;