/* Move registers around to reduce number of move instructions needed.
- Copyright (C) 1987, 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997,
- 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+ Copyright (C) 1987, 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
+ 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
Free Software Foundation, Inc.
This file is part of GCC.
#include "system.h"
#include "coretypes.h"
#include "tm.h"
-#include "rtl.h" /* stdio.h must precede rtl.h for FFS. */
+#include "rtl.h"
#include "tm_p.h"
#include "insn-config.h"
#include "recog.h"
+#include "target.h"
#include "output.h"
#include "regs.h"
#include "hard-reg-set.h"
#include "expr.h"
#include "basic-block.h"
#include "except.h"
-#include "toplev.h"
+#include "diagnostic-core.h"
#include "reload.h"
#include "timevar.h"
#include "tree-pass.h"
/* Return nonzero if registers with CLASS1 and CLASS2 can be merged without
causing too much register allocation problems. */
static int
-regclass_compatible_p (enum reg_class class0, enum reg_class class1)
+regclass_compatible_p (reg_class_t class0, reg_class_t class1)
{
return (class0 == class1
|| (reg_class_subset_p (class0, class1)
- && ! CLASS_LIKELY_SPILLED_P (class0))
+ && ! targetm.class_likely_spilled_p (class0))
|| (reg_class_subset_p (class1, class0)
- && ! CLASS_LIKELY_SPILLED_P (class1)));
+ && ! targetm.class_likely_spilled_p (class1)));
}
\f
/* We don't want to mess with hard regs if register classes are small. */
if (sregno == dregno
- || (SMALL_REGISTER_CLASSES
+ || (targetm.small_register_classes_for_mode_p (GET_MODE (src))
&& (sregno < FIRST_PSEUDO_REGISTER
|| dregno < FIRST_PSEUDO_REGISTER))
/* We don't see all updates to SP if they are in an auto-inc memory
rtx src_reg = XEXP (src, 0);
int src_no = REGNO (src_reg);
int dst_no = REGNO (dest);
- rtx p, set;
+ rtx p, set, set_insn;
enum machine_mode old_mode;
basic_block bb = BLOCK_FOR_INSN (insn);
GET_MODE_BITSIZE (GET_MODE (src_reg))))
return;
+ set_insn = p;
old_mode = GET_MODE (src_reg);
PUT_MODE (src_reg, GET_MODE (src));
XEXP (src, 0) = SET_SRC (set);
}
else
{
- rtx note = find_reg_note (p, REG_EQUAL, NULL_RTX);
+ rtx note = find_reg_note (set_insn, REG_EQUAL, NULL_RTX);
if (note)
- remove_note (p, note);
+ {
+ if (rtx_equal_p (XEXP (note, 0), XEXP (src, 0)))
+ {
+ XEXP (note, 0)
+ = gen_rtx_fmt_e (GET_CODE (src), GET_MODE (src),
+ XEXP (note, 0));
+ df_notes_rescan (set_insn);
+ }
+ else
+ remove_note (set_insn, note);
+ }
}
}
df_note_add_problem ();
df_analyze ();
- if (flag_ira_loop_pressure)
- ira_set_pseudo_classes (dump_file);
-
regstat_init_n_sets_and_refs ();
regstat_compute_ri ();
+ if (flag_ira_loop_pressure)
+ ira_set_pseudo_classes (dump_file);
+
regno_src_regno = XNEWVEC (int, nregs);
for (i = nregs; --i >= 0; )
regno_src_regno[i] = -1;
case 'j': case 'k': case 'l': case 'p': case 'q': case 't': case 'u':
case 'v': case 'w': case 'x': case 'y': case 'z': case 'A': case 'B':
case 'C': case 'D': case 'W': case 'Y': case 'Z':
- if (CLASS_LIKELY_SPILLED_P (REG_CLASS_FROM_CONSTRAINT ((unsigned char) c, p) ))
+ if (targetm.class_likely_spilled_p (REG_CLASS_FROM_CONSTRAINT ((unsigned char) c, p)))
likely_spilled[op_no] = 1;
break;
}