aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-scopedtables.h
diff options
context:
space:
mode:
authorJeff Law <law@redhat.com>2017-08-22 09:13:09 -0600
committerJeff Law <law@gcc.gnu.org>2017-08-22 09:13:09 -0600
commit0db8ddfcb660397bab428ce0d271967d24c23177 (patch)
tree4004740d0a74395c77ee7b55de8e23b4d1a201a6 /gcc/tree-ssa-scopedtables.h
parentd4c550fd0ecb17d577353074c58283e942d1f870 (diff)
downloadgcc-0db8ddfcb660397bab428ce0d271967d24c23177.zip
gcc-0db8ddfcb660397bab428ce0d271967d24c23177.tar.gz
gcc-0db8ddfcb660397bab428ce0d271967d24c23177.tar.bz2
re PR tree-optimization/81741 (Misoptimisation : replacing a constant field read access by a function call)
PR tree-optimization/81741 PR tree-optimization/71947 * tree-ssa-dom.c: Include tree-inline.h. (record_temporary_equivalences): Only record SSA_NAME = SSA_NAME equivalences if one is more expensive to compute than the other. * tree-ssa-scopedtables.h (class const_or_copies): Make record_const_or_copy_raw method private. (class avail_exprs_stack): New method simplify_binary_operation. * tree-ssa-scopedtables.c (avail_exprs_stack::lookup_avail_expr): Call avail_exprs_stack::simplify_binary_operation as needed. (avail_exprs_stack::simplify_binary_operation): New function. PR tree-optimization/81741 PR tree-optimization/71947 * gcc.dg/tree-ssa/pr81741.c: New test. * gcc.dg/tree-ssa/pr71947-7.c: New test. * gcc.dg/tree-ssa/pr71947-8.c: New test. * gcc.dg/tree-ssa/pr71947-9.c: New test. * gcc.dg/tree-ssa/pr71941-1.c: Tweak expected output. * gcc.dg/tree-ssa/pr71941-2.c: Tweak expected output. * gcc.dg/tree-ssa/pr71941-3.c: Tweak expected output. * gcc.dg/tree-ssa/20030922-2.c: xfail. From-SVN: r251279
Diffstat (limited to 'gcc/tree-ssa-scopedtables.h')
-rw-r--r--gcc/tree-ssa-scopedtables.h13
1 files changed, 9 insertions, 4 deletions
diff --git a/gcc/tree-ssa-scopedtables.h b/gcc/tree-ssa-scopedtables.h
index df304ae..e3d7bff 100644
--- a/gcc/tree-ssa-scopedtables.h
+++ b/gcc/tree-ssa-scopedtables.h
@@ -156,6 +156,11 @@ class avail_exprs_stack
vec<std::pair<expr_hash_elt_t, expr_hash_elt_t> > m_stack;
hash_table<expr_elt_hasher> *m_avail_exprs;
+ /* For some assignments where the RHS is a binary operator, if we know
+ a equality relationship between the operands, we may be able to compute
+ a result, even if we don't know the exact value of the operands. */
+ tree simplify_binary_operation (gimple *, class expr_hash_elt);
+
/* We do not allow copying this object or initializing one
from another. */
avail_exprs_stack& operator= (const avail_exprs_stack&);
@@ -185,10 +190,6 @@ class const_and_copies
may follow the value chain for the RHS. */
void record_const_or_copy (tree, tree);
- /* Record a single const/copy pair that can be unwound. This version
- does not follow the value chain for the RHS. */
- void record_const_or_copy_raw (tree, tree, tree);
-
/* Special entry point when we want to provide an explicit previous
value for the first argument. Try to get rid of this in the future.
@@ -196,6 +197,10 @@ class const_and_copies
void record_const_or_copy (tree, tree, tree);
private:
+ /* Record a single const/copy pair that can be unwound. This version
+ does not follow the value chain for the RHS. */
+ void record_const_or_copy_raw (tree, tree, tree);
+
vec<tree> m_stack;
const_and_copies& operator= (const const_and_copies&);
const_and_copies (class const_and_copies &);