From f607c5c4b7720bdc62998ebb2b64d4d093690d5c Mon Sep 17 00:00:00 2001 From: Vladimir Makarov Date: Sun, 16 Nov 2014 05:00:30 +0000 Subject: [PATCH] lra-remat.c (cand_transf_func): Process regno for rematerialization too. 2014-11-15 Vladimir Makarov * lra-remat.c (cand_transf_func): Process regno for rematerialization too. * lra.c (lra): Switch on rematerialization pass. From-SVN: r217624 --- gcc/ChangeLog | 6 ++++++ gcc/lra-remat.c | 4 ++++ gcc/lra.c | 2 +- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b50fd1865b7..758c3adbaf3 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2014-11-15 Vladimir Makarov + + * lra-remat.c (cand_transf_func): Process regno for + rematerialization too. + * lra.c (lra): Switch on rematerialization pass. + 2014-11-15 Vladimir Makarov * lra.c (lra): Switch off rematerialization pass. diff --git a/gcc/lra-remat.c b/gcc/lra-remat.c index f638a1d8740..fcb1b6f6097 100644 --- a/gcc/lra-remat.c +++ b/gcc/lra-remat.c @@ -860,6 +860,10 @@ cand_trans_fun (int bb_index, bitmap bb_in, bitmap bb_out) bitmap_set_bit (&temp_bitmap, cid); break; } + /* Check regno for rematerialization. */ + if (bitmap_bit_p (bb_changed_regs, cand->regno) + || bitmap_bit_p (bb_dead_regs, cand->regno)) + bitmap_set_bit (&temp_bitmap, cid); } return bitmap_ior_and_compl (bb_out, &bb_info->gen_cands, bb_in, &temp_bitmap); diff --git a/gcc/lra.c b/gcc/lra.c index 661a3842707..9309d5e44c2 100644 --- a/gcc/lra.c +++ b/gcc/lra.c @@ -2354,7 +2354,7 @@ lra (FILE *f) break; /* Now we know what pseudos should be spilled. Try to rematerialize them first. */ - if (0&&lra_remat ()) + if (lra_remat ()) { /* We need full live info -- see the comment above. */ lra_create_live_ranges (lra_reg_spill_p, true); -- 2.30.2