aboutsummaryrefslogtreecommitdiff
path: root/gcc/gimple-match-head.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2015-10-01 07:54:26 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2015-10-01 07:54:26 +0000
commit34050b6bee181a12099a9bc31a4d25469573bc6d (patch)
tree84b464b97cc715dd2e30f73f4fc420d296b60500 /gcc/gimple-match-head.c
parente01c66ca3083cf998d7e2f568ff6227f86727499 (diff)
downloadgcc-34050b6bee181a12099a9bc31a4d25469573bc6d.zip
gcc-34050b6bee181a12099a9bc31a4d25469573bc6d.tar.gz
gcc-34050b6bee181a12099a9bc31a4d25469573bc6d.tar.bz2
gimple-match.h (mprts_hook): Declare.
2015-10-01 Richard Biener <rguenther@suse.de> * gimple-match.h (mprts_hook): Declare. * gimple-match.head.c (mprts_hook): Define. (maybe_push_res_to_seq): Use new hook. * gimple-fold.c (gimple_fold_stmt_to_constant_1): Likewise. * tree-ssa-sccvn.h (vn_ssa_aux::expr): Change to a gimple_seq. (vn_ssa_aux::has_constants): Remove. * tree-ssa-sccvn.c: Include gimple-match.h. (VN_INFO_GET): Assert we don't re-use SSA names. (vn_get_expr_for): Remove. (expr_has_constants): Likewise. (stmt_has_constants): Likewise. (simplify_binary_expression): Likewise. (simplify_unary_expression): Likewise. (vn_lookup_simplify_result): New hook. (visit_copy): Adjust. (visit_reference_op_call): Likewise. (visit_phi): Likewise. (visit_use): Likewise. (process_scc): Likewise. (init_scc_vn): Likewise. (visit_reference_op_load): Likewise. Use match-and-simplify and a gimple seq for inserted expressions. (try_to_simplify): Remove GENERIC stmt combining code. (sccvn_dom_walker::before_dom_children): Use match-and-simplify. * tree-ssa-pre.c (eliminate_insert): Adjust. (eliminate_dom_walker::before_dom_children): Likewise. * gcc.dg/tree-ssa/ssa-fre-7.c: Adjust. * gcc.dg/tree-ssa/ssa-fre-8.c: Likewise. From-SVN: r228320
Diffstat (limited to 'gcc/gimple-match-head.c')
-rw-r--r--gcc/gimple-match-head.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/gcc/gimple-match-head.c b/gcc/gimple-match-head.c
index 0587ce1..cab77a4 100644
--- a/gcc/gimple-match-head.c
+++ b/gcc/gimple-match-head.c
@@ -293,6 +293,8 @@ maybe_build_generic_op (enum tree_code code, tree type,
}
}
+tree (*mprts_hook) (code_helper, tree, tree *);
+
/* Push the exploded expression described by RCODE, TYPE and OPS
as a statement to SEQ if necessary and return a gimple value
denoting the value of the expression. If RES is not NULL
@@ -310,6 +312,12 @@ maybe_push_res_to_seq (code_helper rcode, tree type, tree *ops,
|| ((tree_code) rcode) == ADDR_EXPR)
&& is_gimple_val (ops[0]))
return ops[0];
+ if (mprts_hook)
+ {
+ tree tem = mprts_hook (rcode, type, ops);
+ if (tem)
+ return tem;
+ }
if (!seq)
return NULL_TREE;
/* Play safe and do not allow abnormals to be mentioned in