@@ -1058,16 +1058,22 @@ get_pressure_class_and_nregs (rtx insn, int *nregs)
}
/* Calculates cost and number of registers needed for moving invariant INV
- out of the loop and stores them to *COST and *REGS_NEEDED. */
+ out of the loop and stores them to *COST and *REGS_NEEDED. *CL will be
+ the REG_CLASS of INV. Return
+ 0: if INV is invalid.
+ 1: if INV and its depends_on have same reg_class
+ > 1: if INV and its depends_on have different reg_classes. */
-static void
-get_inv_cost (struct invariant *inv, int *comp_cost, unsigned *regs_needed)
+static int
+get_inv_cost (struct invariant *inv, int *comp_cost, unsigned *regs_needed,
+ enum reg_class *cl)
{
int i, acomp_cost;
unsigned aregs_needed[N_REG_CLASSES];
unsigned depno;
struct invariant *dep;
bitmap_iterator bi;
+ int ret = 2;
/* Find the representative of the class of the equivalent invariants. */
inv = invariants[inv->eqto];
@@ -1083,7 +1089,7 @@ get_inv_cost (struct invariant *inv, int
*comp_cost, unsigned *regs_needed)
if (inv->move
|| inv->stamp == actual_stamp)
- return;
+ return 0;
inv->stamp = actual_stamp;