PR tree-optimization/52272
authoramker <amker@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 20 Nov 2015 09:05:08 +0000 (09:05 +0000)
committeramker <amker@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 20 Nov 2015 09:05:08 +0000 (09:05 +0000)
commitdf3eb2ed47f0e5e7280aba3b2f75022ec28aa3de
treea0eaeaabd9ad7f71b77adb0cf347dee329391c0e
parentd3d81eb2ee1266baeb4d3b5462b7bd538265fd12
PR tree-optimization/52272
* tree-ssa-loop-ivopts.c (struct iv_common_cand): New struct.
(struct iv_common_cand_hasher): New struct.
(iv_common_cand_hasher::hash): New function.
(iv_common_cand_hasher::equal): New function.
(struct ivopts_data): New fields, iv_common_cand_tab and
iv_common_cands.
(tree_ssa_iv_optimize_init): Initialize above fields.
(record_common_cand, common_cand_cmp): New functions.
(add_iv_candidate_derived_from_uses): New function.
(add_iv_candidate_for_use): Record iv_common_cands derived from
iv use in hash table, instead of adding candidates directly.
(add_iv_candidate_for_uses): Call add_iv_candidate_derived_from_uses.
(record_important_candidates): Add important candidates to iv uses'
related_cands.  Always keep related_cands for future use.
(try_add_cand_for): Use iv uses' related_cands.
(free_loop_data, tree_ssa_iv_optimize_finalize): Release new fields
in struct ivopts_data, iv_common_cand_tab and iv_common_cands.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@230647 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/tree-ssa-loop-ivopts.c