diff options
author | Richard Sandiford <rsandifo@gcc.gnu.org> | 2017-08-30 11:11:16 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@gcc.gnu.org> | 2017-08-30 11:11:16 +0000 |
commit | 673bf5a6b65e51d177d2cf9fc4002171b1f467ab (patch) | |
tree | 6c897f8eed13c0d78998341ce2a350c204fa4667 /gcc/combine.c | |
parent | 45e8e706e295e7770d02c6d9c9798f4bab7ab524 (diff) | |
download | gcc-673bf5a6b65e51d177d2cf9fc4002171b1f467ab.zip gcc-673bf5a6b65e51d177d2cf9fc4002171b1f467ab.tar.gz gcc-673bf5a6b65e51d177d2cf9fc4002171b1f467ab.tar.bz2 |
[23/77] Replace != VOIDmode checks with is_a <scalar_int_mode>
This patch replaces some checks against VOIDmode with checks
of is_a <scalar_int_mode>, in cases where scalar integer modes
were the only useful alternatives left.
gcc/
2017-08-30 Richard Sandiford <richard.sandiford@linaro.org>
Alan Hayward <alan.hayward@arm.com>
David Sherwood <david.sherwood@arm.com>
* cfgexpand.c (expand_debug_expr): Use is_a <scalar_int_mode>
instead of != VOIDmode.
* combine.c (if_then_else_cond): Likewise.
(change_zero_ext): Likewise.
* dwarf2out.c (mem_loc_descriptor): Likewise.
(loc_descriptor): Likewise.
* rtlanal.c (canonicalize_condition): Likewise.
* simplify-rtx.c (simplify_relational_operation_1): Likewise.
From-SVN: r251475
Diffstat (limited to 'gcc/combine.c')
-rw-r--r-- | gcc/combine.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/gcc/combine.c b/gcc/combine.c index b2f6c09..7239ae3 100644 --- a/gcc/combine.c +++ b/gcc/combine.c @@ -9019,6 +9019,7 @@ if_then_else_cond (rtx x, rtx *ptrue, rtx *pfalse) enum rtx_code code = GET_CODE (x); rtx cond0, cond1, true0, true1, false0, false1; unsigned HOST_WIDE_INT nz; + scalar_int_mode int_mode; /* If we are comparing a value against zero, we are done. */ if ((code == NE || code == EQ) @@ -9215,8 +9216,9 @@ if_then_else_cond (rtx x, rtx *ptrue, rtx *pfalse) /* If X is known to be either 0 or -1, those are the true and false values when testing X. */ else if (x == constm1_rtx || x == const0_rtx - || (mode != VOIDmode && mode != BLKmode - && num_sign_bit_copies (x, mode) == GET_MODE_PRECISION (mode))) + || (is_a <scalar_int_mode> (mode, &int_mode) + && (num_sign_bit_copies (x, int_mode) + == GET_MODE_PRECISION (int_mode)))) { *ptrue = constm1_rtx, *pfalse = const0_rtx; return x; @@ -11271,7 +11273,7 @@ change_zero_ext (rtx pat) FOR_EACH_SUBRTX_PTR (iter, array, src, NONCONST) { rtx x = **iter; - scalar_int_mode mode; + scalar_int_mode mode, inner_mode; if (!is_a <scalar_int_mode> (GET_MODE (x), &mode)) continue; int size; @@ -11279,12 +11281,9 @@ change_zero_ext (rtx pat) if (GET_CODE (x) == ZERO_EXTRACT && CONST_INT_P (XEXP (x, 1)) && CONST_INT_P (XEXP (x, 2)) - && GET_MODE (XEXP (x, 0)) != VOIDmode - && GET_MODE_PRECISION (GET_MODE (XEXP (x, 0))) - <= GET_MODE_PRECISION (mode)) + && is_a <scalar_int_mode> (GET_MODE (XEXP (x, 0)), &inner_mode) + && GET_MODE_PRECISION (inner_mode) <= GET_MODE_PRECISION (mode)) { - machine_mode inner_mode = GET_MODE (XEXP (x, 0)); - size = INTVAL (XEXP (x, 1)); int start = INTVAL (XEXP (x, 2)); |