summaryrefslogtreecommitdiff
path: root/gcc/combine.c
diff options
context:
space:
mode:
authorrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>2017-08-30 11:11:16 +0000
committerrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>2017-08-30 11:11:16 +0000
commit1aa8738f7ec89f1c1166adb97fc6eaf51d0c295e (patch)
tree6c897f8eed13c0d78998341ce2a350c204fa4667 /gcc/combine.c
parent306f8ff589a9d0fb4eac68d90001f8d36f8fd542 (diff)
downloadgcc-1aa8738f7ec89f1c1166adb97fc6eaf51d0c295e.tar.gz
[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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@251475 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/combine.c')
-rw-r--r--gcc/combine.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/gcc/combine.c b/gcc/combine.c
index b2f6c093231..7239ae3e74c 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));