* tree-predcom.c: Add general comment on Store-Store chains.
commit83c06cf0a07c033eda49b38a38ee00f9c5f8797a
authoramker <amker@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 20 Nov 2017 14:20:08 +0000 (20 14:20 +0000)
committeramker <amker@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 20 Nov 2017 14:20:08 +0000 (20 14:20 +0000)
tree9ce904293837925904cc45a82747acaecf2be5be
parent1f2cbf12dda73c04ec7ac026b495db43b1c272fa
* tree-predcom.c: Add general comment on Store-Store chains.
(split_data_refs_to_components): Postpone clearing eliminate_store_p
flag in component.
(get_chain_last_ref_at): Rename into...
(get_chain_last_write_at): ...this.
(get_chain_last_write_before_load): New function.
(add_ref_to_chain): Promote type of chain from CT_STORE_LOAD to
CT_STORE_STORE when write reference is added.
(determine_roots_comp): Support load ref in CT_STORE_STORE chains.
(is_inv_store_elimination_chain): Update get_chain_last_write_at call.
(initialize_root_vars_store_elim_1): Ditto.
(initialize_root_vars_store_elim_2): Ditto.  Replace rhs once default
definition is created.
(execute_pred_commoning_chain): Support load ref in CT_STORE_STORE
chain by replacing it with dominant stored value.

gcc/testsuite
* gcc.dg/tree-ssa/predcom-dse-12.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@254956 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/tree-ssa/predcom-dse-12.c [new file with mode: 0644]
gcc/tree-predcom.c