diff options
author | vmakarov <vmakarov@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-02-27 14:15:02 +0000 |
---|---|---|
committer | vmakarov <vmakarov@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-02-27 14:15:02 +0000 |
commit | fb87313ed79529d712e8f7baff7824d21d350a21 (patch) | |
tree | b0e84591587c4cc454af79175826ad4134a0b336 /gcc/lra.c | |
parent | 495cbfb8c9740c60a870fa1e5ad7df41ce29a2d7 (diff) | |
download | gcc-fb87313ed79529d712e8f7baff7824d21d350a21.tar.gz |
2015-02-27 Vladimir Makarov <vmakarov@redhat.com>
PR target/65032
* lra-remat.c (update_scratch_ops): New.
(do_remat): Call it.
* lra.c (lra_register_new_scratch_op): New. Take code from ...
(remove_scratches): ... here.
* lra-int.h (lra_register_new_scratch_op): New prototype.
2015-02-27 Vladimir Makarov <vmakarov@redhat.com>
PR target/65032
* g++.dg/pr65032.C: New.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@221062 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/lra.c')
-rw-r--r-- | gcc/lra.c | 29 |
1 files changed, 19 insertions, 10 deletions
diff --git a/gcc/lra.c b/gcc/lra.c index abe0c334b32..727a70e0630 100644 --- a/gcc/lra.c +++ b/gcc/lra.c @@ -1907,6 +1907,24 @@ lra_former_scratch_operand_p (rtx_insn *insn, int nop) INSN_UID (insn) * MAX_RECOG_OPERANDS + nop) != 0; } +/* Register operand NOP in INSN as a former scratch. It will be + changed to scratch back, if it is necessary, at the LRA end. */ +void +lra_register_new_scratch_op (rtx_insn *insn, int nop) +{ + lra_insn_recog_data_t id = lra_get_insn_recog_data (insn); + rtx op = *id->operand_loc[nop]; + sloc_t loc = XNEW (struct sloc); + lra_assert (REG_P (op)); + loc->insn = insn; + loc->nop = nop; + scratches.safe_push (loc); + bitmap_set_bit (&scratch_bitmap, REGNO (op)); + bitmap_set_bit (&scratch_operand_bitmap, + INSN_UID (insn) * MAX_RECOG_OPERANDS + nop); + add_reg_note (insn, REG_UNUSED, op); +} + /* Change scratches onto pseudos and save their location. */ static void remove_scratches (void) @@ -1916,7 +1934,6 @@ remove_scratches (void) basic_block bb; rtx_insn *insn; rtx reg; - sloc_t loc; lra_insn_recog_data_t id; struct lra_static_insn_data *static_id; @@ -1938,15 +1955,7 @@ remove_scratches (void) *id->operand_loc[i] = reg = lra_create_new_reg (static_id->operand[i].mode, *id->operand_loc[i], ALL_REGS, NULL); - add_reg_note (insn, REG_UNUSED, reg); - lra_update_dup (id, i); - loc = XNEW (struct sloc); - loc->insn = insn; - loc->nop = i; - scratches.safe_push (loc); - bitmap_set_bit (&scratch_bitmap, REGNO (*id->operand_loc[i])); - bitmap_set_bit (&scratch_operand_bitmap, - INSN_UID (insn) * MAX_RECOG_OPERANDS + i); + lra_register_new_scratch_op (insn, i); if (lra_dump_file != NULL) fprintf (lra_dump_file, "Removing SCRATCH in insn #%u (nop %d)\n", |