re PR tree-optimization/71915 (A missed opportunity for SLSR)
authorBill Schmidt <wschmidt@linux.vnet.ibm.com>
Mon, 31 Oct 2016 03:04:59 +0000 (03:04 +0000)
committerWilliam Schmidt <wschmidt@gcc.gnu.org>
Mon, 31 Oct 2016 03:04:59 +0000 (03:04 +0000)
commit0b56e9adf84be945617a8026a334dd6f14c1c679
tree9a26ae33b30338b694ff1694c28a109e28bbaa5f
parent8972aa3362ab322891f482725d3866ccf265bb3a
re PR tree-optimization/71915 (A missed opportunity for SLSR)

[gcc]

2016-10-30  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

PR tree-optimization/71915
PR tree-optimization/71490
* gimple-ssa-strength-reduction.c (struct slsr_cand_d): Add
stride_type field.
(find_basis_for_base_expr): Require stride types to match when
seeking a basis.
(alloc_cand_and_find_basis): Record the stride type.
(slsr_process_phi): Pass stride type to alloc_cand_and_find_basis.
(backtrace_base_for_ref): Pass types to legal_cast_p_1 rather than
the expressions having those types.
(slsr_process_ref): Pass stride type to alloc_cand_and_find_basis.
(create_mul_ssa_cand): Likewise.
(create_mul_imm_cand): Likewise.
(create_add_ssa_cand): Likewise.
(create_add_imm_cand): Likewise.
(legal_cast_p_1): Change interface to accept types rather than the
expressions having those types.
(legal_cast_p): Pass types to legal_cast_p_1.
(slsr_process_cast): Pass stride type to
alloc_cand_and_find_basis.
(slsr_process_copy): Likewise.
(dump_candidate): Display stride type when a cast exists.
(create_add_on_incoming_edge): Introduce a cast when necessary for
the stride type.
(analyze_increments): Change the code checking for invalid casts
to rely on the stride type, and update the documentation and
example.  Change the code checking for pointer multiplies to rely
on the stride type.
(insert_initializers): Introduce a cast when necessary for the
stride type.  Use the stride type for the type of the initializer.

[gcc/testsuite]

2016-10-30  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

PR tree-optimization/71915
PR tree-optimization/71490
* gcc.dg/tree-ssa/pr54245.c: Delete.
* gcc.dg/tree-ssa/slsr-8.c: Adjust for new optimization and
document why.

From-SVN: r241695
gcc/ChangeLog
gcc/gimple-ssa-strength-reduction.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/tree-ssa/pr54245.c [deleted file]
gcc/testsuite/gcc.dg/tree-ssa/slsr-8.c