diff options
author | Richard Sandiford <richard.sandiford@linaro.org> | 2017-08-30 11:10:36 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@gcc.gnu.org> | 2017-08-30 11:10:36 +0000 |
commit | 304b9962830476dce3fe7632713e5f5ce002c050 (patch) | |
tree | 4357020c2fa6f4639a809965e72c48c49d2ceb7c /gcc/dse.c | |
parent | fffbab82e7fd15ef695159746a0ce7b9ac906778 (diff) | |
download | gcc-304b9962830476dce3fe7632713e5f5ce002c050.zip gcc-304b9962830476dce3fe7632713e5f5ce002c050.tar.gz gcc-304b9962830476dce3fe7632713e5f5ce002c050.tar.bz2 |
[18/77] Make int_mode_for_mode return an opt_scalar_int_mode
Also use int_mode_for_mode instead of (int_)mode_for_size
in cases where the requested size was the bitsize of an
existing mode.
2017-08-30 Richard Sandiford <richard.sandiford@linaro.org>
Alan Hayward <alan.hayward@arm.com>
David Sherwood <david.sherwood@arm.com>
gcc/
* machmode.h (opt_mode::else_blk): New function.
(int_mode_for_mode): Declare.
* stor-layout.c (int_mode_for_mode): Return an opt_scalar_int_mode.
* builtins.c (expand_builtin_signbit): Adjust for new int_mode_for_mode
return type.
* cfgexpand.c (expand_debug_expr): Likewise.
* combine.c (gen_lowpart_or_truncate): Likewise.
(gen_lowpart_for_combine): Likewise.
* config/aarch64/aarch64.c (aarch64_emit_approx_sqrt): Likewise.
* config/avr/avr.c (avr_to_int_mode): Likewise.
(avr_out_plus_1): Likewise.
(avr_out_plus): Likewise.
(avr_out_round): Likewise.
* config/i386/i386.c (ix86_split_to_parts): Likewise.
* config/s390/s390.c (s390_expand_vec_compare_cc): Likewise.
(s390_expand_vcond): Likewise.
* config/spu/spu.c (spu_split_immediate): Likewise.
(spu_expand_mov): Likewise.
* dse.c (get_stored_val): Likewise.
* expmed.c (store_bit_field_1): Likewise.
(convert_extracted_bit_field): Use int_mode_for_mode instead of
int_mode_for_size.
(extract_bit_field_1): Adjust for new int_mode_for_mode return type.
(extract_low_bits): Likewise.
* expr.c (emit_group_load_1): Likewise. Separate out the BLKmode
handling rather than repeating the check.
(emit_group_store): Likewise.
(emit_move_via_integer): Adjust for new int_mode_for_mode return type.
* optabs.c (expand_absneg_bit): Likewise.
(expand_copysign_absneg): Likewise.
(expand_copysign_bit): Likewise.
* tree-if-conv.c (ifcvt_can_use_mask_load_store): Likewise.
* tree-vect-slp.c (vect_transform_slp_perm_load): Likewise.
* tree-vect-stmts.c (vect_gen_perm_mask_any): Likewise.
* var-tracking.c (prepare_call_arguments): Likewise.
* config/powerpcspe/powerpcspe.c (rs6000_do_expand_vec_perm): Use
int_mode_for_mode instead of mode_for_size.
* config/rs6000/rs6000.c (rs6000_do_expand_vec_perm): Likewise.
Co-Authored-By: Alan Hayward <alan.hayward@arm.com>
Co-Authored-By: David Sherwood <david.sherwood@arm.com>
From-SVN: r251470
Diffstat (limited to 'gcc/dse.c')
-rw-r--r-- | gcc/dse.c | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -1734,12 +1734,12 @@ get_stored_val (store_info *store_info, machine_mode read_mode, { /* The store is a memset (addr, const_val, const_size). */ gcc_assert (CONST_INT_P (store_info->rhs)); - store_mode = int_mode_for_mode (read_mode); - if (store_mode == BLKmode) + scalar_int_mode int_store_mode; + if (!int_mode_for_mode (read_mode).exists (&int_store_mode)) read_reg = NULL_RTX; else if (store_info->rhs == const0_rtx) - read_reg = extract_low_bits (read_mode, store_mode, const0_rtx); - else if (GET_MODE_BITSIZE (store_mode) > HOST_BITS_PER_WIDE_INT + read_reg = extract_low_bits (read_mode, int_store_mode, const0_rtx); + else if (GET_MODE_BITSIZE (int_store_mode) > HOST_BITS_PER_WIDE_INT || BITS_PER_UNIT >= HOST_BITS_PER_WIDE_INT) read_reg = NULL_RTX; else @@ -1753,8 +1753,8 @@ get_stored_val (store_info *store_info, machine_mode read_mode, c |= (c << shift); shift <<= 1; } - read_reg = gen_int_mode (c, store_mode); - read_reg = extract_low_bits (read_mode, store_mode, read_reg); + read_reg = gen_int_mode (c, int_store_mode); + read_reg = extract_low_bits (read_mode, int_store_mode, read_reg); } } else if (store_info->const_rhs |