]> git.ipfire.org Git - thirdparty/gcc.git/commit
[26/77] Use is_a <scalar_int_mode> in subreg/extract simplifications
authorrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 30 Aug 2017 11:11:42 +0000 (11:11 +0000)
committerrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 30 Aug 2017 11:11:42 +0000 (11:11 +0000)
commit4c53345c9729e2d4268c8b3461a1dc524926b368
treee5f94df609e868850d97acfc272b72bc5ed4ed4b
parent5c7e74d437adbc0e980d1c3a60a4bd36cbcf2907
[26/77] Use is_a <scalar_int_mode> in subreg/extract simplifications

This patch adds is_a <scalar_int_mode> checks to various places that
were optimising subregs or extractions in ways that only made sense
for scalar integers.  Often the subreg transformations were looking
for extends, truncates or shifts and trying to remove the subreg, which
wouldn't be correct if the SUBREG_REG was a vector rather than a scalar.

The simplify_binary_operation_1 part also removes a redundant:

  GET_MODE (opleft) == GET_MODE (XEXP (opright, 0))

since this must be true for:

  (ior A (lshifrt B ...))  A == opleft, B == XEXP (opright, 0)

2017-08-30  Richard Sandiford  <richard.sandiford@linaro.org>
    Alan Hayward  <alan.hayward@arm.com>
    David Sherwood  <david.sherwood@arm.com>

gcc/
* combine.c (find_split_point): Add is_a <scalar_int_mode> checks.
(make_compound_operation_int): Likewise.
(change_zero_ext): Likewise.
* expr.c (convert_move): Likewise.
(convert_modes): Likewise.
* fwprop.c (forward_propagate_subreg): Likewise.
* loop-iv.c (get_biv_step_1): Likewise.
* optabs.c (widen_operand): Likewise.
* postreload.c (move2add_valid_value_p): Likewise.
* recog.c (simplify_while_replacing): Likewise.
* simplify-rtx.c (simplify_unary_operation_1): Likewise.
(simplify_binary_operation_1): Likewise.  Remove redundant
mode equality check.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@251478 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/combine.c
gcc/expr.c
gcc/fwprop.c
gcc/loop-iv.c
gcc/optabs.c
gcc/postreload.c
gcc/recog.c
gcc/simplify-rtx.c