diff options
author | Jeff Law <law@redhat.com> | 2017-03-15 21:19:35 -0600 |
---|---|---|
committer | Jeff Law <law@gcc.gnu.org> | 2017-03-15 21:19:35 -0600 |
commit | a3d514f231af029090ba40ebcdae4226b739433c (patch) | |
tree | d8b855bb9e915146c36b899deea5e22a52c0e3b0 /gcc/tree-ssa-scopedtables.h | |
parent | 47ee2e074177123e4553654a9c898d46437063c9 (diff) | |
download | gcc-a3d514f231af029090ba40ebcdae4226b739433c.zip gcc-a3d514f231af029090ba40ebcdae4226b739433c.tar.gz gcc-a3d514f231af029090ba40ebcdae4226b739433c.tar.bz2 |
re PR tree-optimization/71437 (Performance regression after r235817)
PR tree-optimization/71437
* tree-ssa-dom.c (struct cond_equivalence): Moved from here into
tree-ssa-scopedtables.
(lookup_avail_expr, build_and_record_new_cond): Likewise.
(record_conditions, record_cond, vuse_eq): Likewise.
(record_edge_info): Adjust to API tweak of record_conditions.
(simplify_stmt_for_jump_threading): Similarly for lookup_avail_expr.
(record_temporary_equivalences, optimize_stmt): Likewise.
(eliminate_redundant_computations): Likewise.
(record_equivalences_from_stmt): Likewise.
* tree-ssa-scopedtables.c: Include options.h and params.h.
(vuse_eq): New function, moved from tree-ssa-dom.c
(build_and_record_new_cond): Likewise.
(record_conditions): Likewise. Accept vector of conditions rather
than edge_equivalence structure for first argument.
for the first argument.
(avail_exprs_stack::lookup_avail_expr): New member function, moved
from tree-ssa-dom.c.
(avail_exprs_stack::record_cond): Likewise.
* tree-ssa-scopedtables.h (struct cond_equivalence): Moved here
from tree-ssa-dom.c.
(avail_exprs_stack): Add new member functions lookup_avail_expr
and record_cond.
(record_conditions): Declare.
From-SVN: r246186
Diffstat (limited to 'gcc/tree-ssa-scopedtables.h')
-rw-r--r-- | gcc/tree-ssa-scopedtables.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/gcc/tree-ssa-scopedtables.h b/gcc/tree-ssa-scopedtables.h index 3e6798a..df304ae 100644 --- a/gcc/tree-ssa-scopedtables.h +++ b/gcc/tree-ssa-scopedtables.h @@ -47,6 +47,20 @@ struct hashable_expr } ops; }; +/* Structure for recording known value of a conditional expression. + + Clients build vectors of these objects to record known values + that occur on edges. */ + +struct cond_equivalence +{ + /* The condition, in a HASHABLE_EXPR form. */ + struct hashable_expr cond; + + /* The result of the condition (true or false. */ + tree value; +}; + /* Structure for entries in the expression hash table. */ typedef class expr_hash_elt * expr_hash_elt_t; @@ -132,6 +146,12 @@ class avail_exprs_stack hash_table<expr_elt_hasher> *avail_exprs (void) { return m_avail_exprs; } + /* Lookup and conditionally insert an expression into the table, + recording enough information to unwind as needed. */ + tree lookup_avail_expr (gimple *, bool, bool); + + void record_cond (cond_equivalence *); + private: vec<std::pair<expr_hash_elt_t, expr_hash_elt_t> > m_stack; hash_table<expr_elt_hasher> *m_avail_exprs; @@ -182,5 +202,6 @@ class const_and_copies }; void initialize_expr_from_cond (tree cond, struct hashable_expr *expr); +void record_conditions (vec<cond_equivalence> *p, tree, tree); #endif /* GCC_TREE_SSA_SCOPED_TABLES_H */ |