summaryrefslogtreecommitdiff
path: root/gcc/ira.c
diff options
context:
space:
mode:
authorsteven <steven@138bc75d-0d04-0410-961f-82ee72b054a4>2012-05-29 15:36:18 +0000
committersteven <steven@138bc75d-0d04-0410-961f-82ee72b054a4>2012-05-29 15:36:18 +0000
commitea1760a3a086054b8adba3a4cc28bac3ad84de91 (patch)
tree7e6eb315a8fd801513f14a09fb9035a39128e409 /gcc/ira.c
parent234d19a4437e3761821a29a18c5c97f5c2aaff61 (diff)
downloadgcc-ea1760a3a086054b8adba3a4cc28bac3ad84de91.tar.gz
* integrate.c: Remove.
* integrate.h: Remove. * Makefile.in: Remove make rules for integrate.c and INTEGRATE_H. * config/arm/t-arm: Remove INTEGRATE_H dependency for target files. * config/rs6000/t-rs6000: Likewise * config/spu/t-spu-elf: Likewise. * function.h (get_hard_reg_initial_val, has_hard_reg_initial_val, get_hard_reg_initial_reg, emit_initial_value_sets): Move prototypes from integrate.h to here. (initial_value_entry): New prototype. * reload.h (allocate_initial_values): Remove prototype. * tree.h (set_decl_abstract_flags, set_decl_origin_self): Likewise. * cse.c (fixed_base_plus_p): Don't handle virtual registers for integrate.c. * dwarf2out.c (set_decl_origin_self, set_block_origin_self, set_decl_abstract_flags, set_block_abstract_flags): Move from integrate.c to here, the only user. * expmed.c (extract_fixed_bit_field): Remove outdated comment about integrate.c. * function.c: Don't include integrate.h. (struct initial_value_pair, struct initial_value_struct, get_hard_reg_initial_val, has_hard_reg_initial_val, get_hard_reg_initial_reg, emit_initial_value_sets): Move from integrate.c to here. (initial_value_entry): New function. * genemit.c (main): Don't print integrate.h include line. * ira.c: Don't include integrate.h. (allocate_initial_values): Move from integrate.c to here. (ira): Update allocate_initial_values call. * tree-inline.c: Don't include integrate.h. (function_attribute_inlinable_p): Moved from integrate.c to here. * cfgexpand.c: Don't include integrate.h. * except.c: Likewise. * langhooks.c: Likewise. * passes.c: Likewise. * toplev.c: Likewise. * config/frv/frv.c: Likewise. * config/pa/pa.c: Likewise. * config/spu/spu.c: Likewise. * config/epiphany/epiphany.c: Likewise. * config/mep/mep.c: Likewise. * config/score/score.c: Likewise. * config/picochip/picochip.c: Likewise. * config/sh/sh.c: Likewise. * config/alpha/alpha.c: Likewise. * config/microblaze/microblaze.c: Likewise. * config/mips/mips.c: Likewise. * config/v850/v850.c: Likewise. * config/mmix/mmix.c: Likewise. * config/bfin/bfin.c: Likewise. * config/arm/arm.c: Likewise. * config/s390/s390.c: Likewise. * config/m32r/m32r.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/c6x/c6x.c: Include function.h instead of integrate.h. * config/tilegx/tilegx.c: Likewise. * config/tilepro/tilepro.c: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@187969 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ira.c')
-rw-r--r--gcc/ira.c52
1 files changed, 50 insertions, 2 deletions
diff --git a/gcc/ira.c b/gcc/ira.c
index 1809e0da83a..f01c6e1022b 100644
--- a/gcc/ira.c
+++ b/gcc/ira.c
@@ -380,7 +380,7 @@ along with GCC; see the file COPYING3. If not see
#include "except.h"
#include "reload.h"
#include "diagnostic-core.h"
-#include "integrate.h"
+#include "function.h"
#include "ggc.h"
#include "ira-int.h"
#include "dce.h"
@@ -4034,7 +4034,55 @@ move_unallocated_pseudos (void)
}
}
+/* If the backend knows where to allocate pseudos for hard
+ register initial values, register these allocations now. */
+void
+allocate_initial_values (void)
+{
+ if (targetm.allocate_initial_value)
+ {
+ rtx hreg, preg, x;
+ int i, regno;
+
+ for (i = 0; HARD_REGISTER_NUM_P (i); i++)
+ {
+ if (! initial_value_entry (i, &hreg, &preg))
+ break;
+
+ x = targetm.allocate_initial_value (hreg);
+ regno = REGNO (preg);
+ if (x && REG_N_SETS (regno) <= 1)
+ {
+ if (MEM_P (x))
+ reg_equiv_memory_loc (regno) = x;
+ else
+ {
+ basic_block bb;
+ int new_regno;
+
+ gcc_assert (REG_P (x));
+ new_regno = REGNO (x);
+ reg_renumber[regno] = new_regno;
+ /* Poke the regno right into regno_reg_rtx so that even
+ fixed regs are accepted. */
+ SET_REGNO (preg, new_regno);
+ /* Update global register liveness information. */
+ FOR_EACH_BB (bb)
+ {
+ if (REGNO_REG_SET_P(df_get_live_in (bb), regno))
+ SET_REGNO_REG_SET (df_get_live_in (bb), new_regno);
+ if (REGNO_REG_SET_P(df_get_live_out (bb), regno))
+ SET_REGNO_REG_SET (df_get_live_out (bb), new_regno);
+ }
+ }
+ }
+ }
+ gcc_checking_assert (! initial_value_entry (FIRST_PSEUDO_REGISTER,
+ &hreg, &preg));
+ }
+}
+
/* All natural loops. */
struct loops ira_loops;
@@ -4239,7 +4287,7 @@ ira (FILE *f)
memset (ira_spilled_reg_stack_slots, 0,
max_regno * sizeof (struct ira_spilled_reg_stack_slot));
}
- allocate_initial_values (reg_equivs);
+ allocate_initial_values ();
/* See comment for find_moveable_pseudos call. */
if (ira_conflicts_p)