tree-predcom.c: Add general comment on Store-Store chains.
authorBin Cheng <bin.cheng@arm.com>
Mon, 20 Nov 2017 14:20:08 +0000 (14:20 +0000)
committerBin Cheng <amker@gcc.gnu.org>
Mon, 20 Nov 2017 14:20:08 +0000 (14:20 +0000)
commit9cdcebf971e71e69a773d729b97cfb55652cca31
tree9ce904293837925904cc45a82747acaecf2be5be
parent90ef577378e880769532ef1f68d7d3da4c2661e7
tree-predcom.c: Add general comment on Store-Store chains.

* 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.

From-SVN: r254956
gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/tree-ssa/predcom-dse-12.c [new file with mode: 0644]
gcc/tree-predcom.c