diff options
author | Richard Sandiford <richard.sandiford@linaro.org> | 2017-08-30 11:12:14 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@gcc.gnu.org> | 2017-08-30 11:12:14 +0000 |
commit | 546513775069e93d5f33f7aae5f1cb26c77ca2c9 (patch) | |
tree | 8a383584e324e07a123acf20a153583961e949e9 /gcc/cse.c | |
parent | 095a49c86a8ac69b5dd6d78edf17b9e3803e5bf8 (diff) | |
download | gcc-546513775069e93d5f33f7aae5f1cb26c77ca2c9.zip gcc-546513775069e93d5f33f7aae5f1cb26c77ca2c9.tar.gz gcc-546513775069e93d5f33f7aae5f1cb26c77ca2c9.tar.bz2 |
[28/77] Use is_a <scalar_int_mode> for miscellaneous types of test
This patch adds is_a <scalar_int_mode> checks to various places
that were explicitly or implicitly restricted to integers already,
in cases where adding an explicit is_a <scalar_int_mode> is useful
for later patches.
In simplify_if_then_else, the:
GET_MODE (XEXP (XEXP (t, 0), N))
expressions were equivalent to:
GET_MODE (XEXP (t, 0))
due to the type of operation.
2017-08-30 Richard Sandiford <richard.sandiford@linaro.org>
Alan Hayward <alan.hayward@arm.com>
David Sherwood <david.sherwood@arm.com>
gcc/
* combine.c (sign_extend_short_imm): Add is_a <scalar_int_mode>
checks.
(try_combine): Likewise.
(simplify_if_then_else): Likewise.
* cse.c (cse_insn): Likewise.
* dwarf2out.c (mem_loc_descriptor): Likewise.
* emit-rtl.c (gen_lowpart_common): Likewise.
* simplify-rtx.c (simplify_truncation): Likewise.
(simplify_binary_operation_1): Likewise.
(simplify_const_relational_operation): Likewise.
(simplify_ternary_operation): Likewise.
* tree-ssa-loop-ivopts.c (force_expr_to_var_cost): Likewise.
Co-Authored-By: Alan Hayward <alan.hayward@arm.com>
Co-Authored-By: David Sherwood <david.sherwood@arm.com>
From-SVN: r251480
Diffstat (limited to 'gcc/cse.c')
-rw-r--r-- | gcc/cse.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -4878,13 +4878,14 @@ cse_insn (rtx_insn *insn) value. */ if (flag_expensive_optimizations && ! src_related + && is_a <scalar_int_mode> (mode, &int_mode) && GET_CODE (src) == AND && CONST_INT_P (XEXP (src, 1)) - && GET_MODE_SIZE (mode) < UNITS_PER_WORD) + && GET_MODE_SIZE (int_mode) < UNITS_PER_WORD) { machine_mode tmode; rtx new_and = gen_rtx_AND (VOIDmode, NULL_RTX, XEXP (src, 1)); - FOR_EACH_WIDER_MODE (tmode, mode) + FOR_EACH_WIDER_MODE (tmode, int_mode) { if (GET_MODE_SIZE (tmode) > UNITS_PER_WORD) break; @@ -4905,7 +4906,7 @@ cse_insn (rtx_insn *insn) if (REG_P (larger_elt->exp)) { src_related - = gen_lowpart (mode, larger_elt->exp); + = gen_lowpart (int_mode, larger_elt->exp); break; } |