Commit c2c47e8f by Ulrich Weigand Committed by Ulrich Weigand

lower-subreg.c (enum classify_move_insn): Rename SIMPLE_PSEUDO_REG_MOVE to…

lower-subreg.c (enum classify_move_insn): Rename SIMPLE_PSEUDO_REG_MOVE to DECOMPOSABLE_SIMPLE_MOVE.

ChangeLog:

	* lower-subreg.c (enum classify_move_insn): Rename
	SIMPLE_PSEUDO_REG_MOVE to DECOMPOSABLE_SIMPLE_MOVE.
	(find_decomposable_subregs): Update.
	(decompose_multiword_subregs): Add DECOMPOSE_COPIES parameter.
	Only mark pseudo-to-pseudo copies as DECOMPOSABLE_SIMPLE_MOVE
	if that parameter is true.
	(rest_of_handle_lower_subreg): Call decompose_multiword_subregs
	with DECOMPOSE_COPIES false.
	(rest_of_handle_lower_subreg2): Call decompose_multiword_subregs
	with DECOMPOSE_COPIES true.

testsuite/ChangeLog:

	* gcc.dg/lower-subreg-1.c: Disable on arm-*-* targets.

From-SVN: r191805
parent 9472dcec
2012-09-27 Ulrich Weigand <ulrich.weigand@linaro.org>
* lower-subreg.c (enum classify_move_insn): Rename
SIMPLE_PSEUDO_REG_MOVE to DECOMPOSABLE_SIMPLE_MOVE.
(find_decomposable_subregs): Update.
(decompose_multiword_subregs): Add DECOMPOSE_COPIES parameter.
Only mark pseudo-to-pseudo copies as DECOMPOSABLE_SIMPLE_MOVE
if that parameter is true.
(rest_of_handle_lower_subreg): Call decompose_multiword_subregs
with DECOMPOSE_COPIES false.
(rest_of_handle_lower_subreg2): Call decompose_multiword_subregs
with DECOMPOSE_COPIES true.
2012-09-27 Marek Polacek <polacek@redhat.com> 2012-09-27 Marek Polacek <polacek@redhat.com>
* doc/gcov.texi (Gcov Data Files): Fix a typo. * doc/gcov.texi (Gcov Data Files): Fix a typo.
......
...@@ -440,9 +440,9 @@ enum classify_move_insn ...@@ -440,9 +440,9 @@ enum classify_move_insn
{ {
/* Not a simple move from one location to another. */ /* Not a simple move from one location to another. */
NOT_SIMPLE_MOVE, NOT_SIMPLE_MOVE,
/* A simple move from one pseudo-register to another. */ /* A simple move we want to decompose. */
SIMPLE_PSEUDO_REG_MOVE, DECOMPOSABLE_SIMPLE_MOVE,
/* A simple move involving a non-pseudo-register. */ /* Any other simple move. */
SIMPLE_MOVE SIMPLE_MOVE
}; };
...@@ -518,7 +518,7 @@ find_decomposable_subregs (rtx *px, void *data) ...@@ -518,7 +518,7 @@ find_decomposable_subregs (rtx *px, void *data)
If this is not a simple copy from one location to another, If this is not a simple copy from one location to another,
then we can not decompose this register. If this is a simple then we can not decompose this register. If this is a simple
copy from one pseudo-register to another, and the mode is right copy we want to decompose, and the mode is right,
then we mark the register as decomposable. then we mark the register as decomposable.
Otherwise we don't say anything about this register -- Otherwise we don't say anything about this register --
it could be decomposed, but whether that would be it could be decomposed, but whether that would be
...@@ -537,7 +537,7 @@ find_decomposable_subregs (rtx *px, void *data) ...@@ -537,7 +537,7 @@ find_decomposable_subregs (rtx *px, void *data)
case NOT_SIMPLE_MOVE: case NOT_SIMPLE_MOVE:
bitmap_set_bit (non_decomposable_context, regno); bitmap_set_bit (non_decomposable_context, regno);
break; break;
case SIMPLE_PSEUDO_REG_MOVE: case DECOMPOSABLE_SIMPLE_MOVE:
if (MODES_TIEABLE_P (GET_MODE (x), word_mode)) if (MODES_TIEABLE_P (GET_MODE (x), word_mode))
bitmap_set_bit (decomposable_context, regno); bitmap_set_bit (decomposable_context, regno);
break; break;
...@@ -553,7 +553,7 @@ find_decomposable_subregs (rtx *px, void *data) ...@@ -553,7 +553,7 @@ find_decomposable_subregs (rtx *px, void *data)
enum classify_move_insn cmi_mem = NOT_SIMPLE_MOVE; enum classify_move_insn cmi_mem = NOT_SIMPLE_MOVE;
/* Any registers used in a MEM do not participate in a /* Any registers used in a MEM do not participate in a
SIMPLE_MOVE or SIMPLE_PSEUDO_REG_MOVE. Do our own recursion SIMPLE_MOVE or DECOMPOSABLE_SIMPLE_MOVE. Do our own recursion
here, and return -1 to block the parent's recursion. */ here, and return -1 to block the parent's recursion. */
for_each_rtx (&XEXP (x, 0), find_decomposable_subregs, &cmi_mem); for_each_rtx (&XEXP (x, 0), find_decomposable_subregs, &cmi_mem);
return -1; return -1;
...@@ -1336,11 +1336,11 @@ dump_choices (bool speed_p, const char *description) ...@@ -1336,11 +1336,11 @@ dump_choices (bool speed_p, const char *description)
} }
/* Look for registers which are always accessed via word-sized SUBREGs /* Look for registers which are always accessed via word-sized SUBREGs
or via copies. Decompose these registers into several word-sized or -if DECOMPOSE_COPIES is true- via copies. Decompose these
pseudo-registers. */ registers into several word-sized pseudo-registers. */
static void static void
decompose_multiword_subregs (void) decompose_multiword_subregs (bool decompose_copies)
{ {
unsigned int max; unsigned int max;
basic_block bb; basic_block bb;
...@@ -1438,8 +1438,15 @@ decompose_multiword_subregs (void) ...@@ -1438,8 +1438,15 @@ decompose_multiword_subregs (void)
cmi = NOT_SIMPLE_MOVE; cmi = NOT_SIMPLE_MOVE;
else else
{ {
/* We mark pseudo-to-pseudo copies as decomposable during the
second pass only. The first pass is so early that there is
good chance such moves will be optimized away completely by
subsequent optimizations anyway.
However, we call find_pseudo_copy even during the first pass
so as to properly set up the reg_copy_graph. */
if (find_pseudo_copy (set)) if (find_pseudo_copy (set))
cmi = SIMPLE_PSEUDO_REG_MOVE; cmi = decompose_copies? DECOMPOSABLE_SIMPLE_MOVE : SIMPLE_MOVE;
else else
cmi = SIMPLE_MOVE; cmi = SIMPLE_MOVE;
} }
...@@ -1640,7 +1647,7 @@ gate_handle_lower_subreg (void) ...@@ -1640,7 +1647,7 @@ gate_handle_lower_subreg (void)
static unsigned int static unsigned int
rest_of_handle_lower_subreg (void) rest_of_handle_lower_subreg (void)
{ {
decompose_multiword_subregs (); decompose_multiword_subregs (false);
return 0; return 0;
} }
...@@ -1649,7 +1656,7 @@ rest_of_handle_lower_subreg (void) ...@@ -1649,7 +1656,7 @@ rest_of_handle_lower_subreg (void)
static unsigned int static unsigned int
rest_of_handle_lower_subreg2 (void) rest_of_handle_lower_subreg2 (void)
{ {
decompose_multiword_subregs (); decompose_multiword_subregs (true);
return 0; return 0;
} }
......
2012-09-27 Ulrich Weigand <ulrich.weigand@linaro.org>
* gcc.dg/lower-subreg-1.c: Disable on arm-*-* targets.
2012-09-27 Jakub Jelinek <jakub@redhat.com> 2012-09-27 Jakub Jelinek <jakub@redhat.com>
PR target/54703 PR target/54703
......
/* { dg-do compile { target { ! { mips64 || { ia64-*-* spu-*-* tilegx-*-* } } } } } */ /* { dg-do compile { target { ! { mips64 || { arm-*-* ia64-*-* spu-*-* tilegx-*-* } } } } } */
/* { dg-options "-O -fdump-rtl-subreg1" } */ /* { dg-options "-O -fdump-rtl-subreg1" } */
/* { dg-skip-if "" { { i?86-*-* x86_64-*-* } && x32 } { "*" } { "" } } */ /* { dg-skip-if "" { { i?86-*-* x86_64-*-* } && x32 } { "*" } { "" } } */
/* { dg-require-effective-target ilp32 } */ /* { dg-require-effective-target ilp32 } */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment