aboutsummaryrefslogtreecommitdiff
path: root/gcc/ira.h
diff options
context:
space:
mode:
authorVladimir N. Makarov <vmakarov@redhat.com>2020-10-30 15:05:22 -0400
committerVladimir N. Makarov <vmakarov@redhat.com>2020-10-30 15:08:23 -0400
commit44fbc9c6e02ca5b8f98f25b514ed7588e7ba733d (patch)
treecb3a5a5e1fbd03203fd0a2842a6ffca63195bc51 /gcc/ira.h
parentbdf6524bc0bfa0908a7a7c52e799dbecbebaefe8 (diff)
downloadgcc-44fbc9c6e02ca5b8f98f25b514ed7588e7ba733d.zip
gcc-44fbc9c6e02ca5b8f98f25b514ed7588e7ba733d.tar.gz
gcc-44fbc9c6e02ca5b8f98f25b514ed7588e7ba733d.tar.bz2
Take insn scratch RA requirements into account in IRA.
The patch changes insn scratches which require registers for all insn alternatives (in other words w/o X constraint in scratch constraint string). This is done before IRA staring its work. LRA still continue to change the rest scratches (with X constraint and in insn created during IRA) into pseudos. As before the patch at the end of LRA work, spilled scratch pseudos (for which X constraint was chosen) changed into scratches back. gcc/ChangeLog: * lra.c (get_scratch_reg): New function. (remove_scratches_1): Rename remove_insn_scratches. Use ira_remove_insn_scratches and get_scratch_reg. (remove_scratches): Do not initialize scratches, scratch_bitmap, and scratch_operand_bitmap. (lra): Call ira_restore_scratches instead of restore_scratches. (struct sloc, sloc_t, scratches, scratch_bitmap) (scratch_operand_bitmap, lra_former_scratch_p) (lra_former_scratch_operand_p, lra_register_new_scratch_op) (restore_scratches): Move them to ... * ira.c: ... here. (former_scratch_p, former_scratch_operand_p): Rename to ira_former_scratch_p and ira_former_scratch_operand_p. (contains_X_constraint_p): New function. (register_new_scratch_op): Rename to ira_register_new_scratch_op. Change it to work for IRA and LRA. (restore_scratches): Rename to ira_restore_scratches. (get_scratch_reg, ira_remove_insn_scratches): New functions. (ira): Call ira_remove_scratches if we use LRA. * ira.h (ira_former_scratch_p, ira_former_scratch_operand_p): New prototypes. (ira_register_new_scratch_op, ira_restore_scratches): New prototypes. (ira_remove_insn_scratches): New prototype. * lra-int.h (lra_former_scratch_p, lra_former_scratch_operand_p): Remove prototypes. (lra_register_new_scratch_op): Ditto. * lra-constraints.c: Rename lra_former_scratch_p and lra_former_scratch_p to ira_former_scratch_p and to ira_former_scratch_p. * lra-remat.c: Ditto. * lra-spills.c: Rename lra_former_scratch_p to ira_former_scratch_p.
Diffstat (limited to 'gcc/ira.h')
-rw-r--r--gcc/ira.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/ira.h b/gcc/ira.h
index 09f40ef..c30f36a 100644
--- a/gcc/ira.h
+++ b/gcc/ira.h
@@ -207,6 +207,13 @@ extern bool ira_bad_reload_regno (int, rtx, rtx);
extern void ira_adjust_equiv_reg_cost (unsigned, int);
+extern bool ira_former_scratch_p (int regno);
+extern bool ira_former_scratch_operand_p (rtx_insn *insn, int nop);
+extern void ira_register_new_scratch_op (rtx_insn *insn, int nop, int icode);
+extern bool ira_remove_insn_scratches (rtx_insn *insn, bool all_p, FILE *dump_file,
+ rtx (*get_reg) (rtx original));
+extern void ira_restore_scratches (FILE *dump_file);
+
/* ira-costs.c */
extern void ira_costs_c_finalize (void);