diff options
author | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-10-09 08:12:18 +0000 |
---|---|---|
committer | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-10-09 08:12:18 +0000 |
commit | 717ceeabec2a3e79448b8db8b3fc930b09c34458 (patch) | |
tree | a54ff8c6d5c8ec6eb2b4f543dcefbd2c343e3444 /gcc/gimple-match.h | |
parent | c05c1b41d370b14bc94421f138d13e76831253d1 (diff) | |
download | gcc-717ceeabec2a3e79448b8db8b3fc930b09c34458.tar.gz |
2015-10-09 Richard Biener <rguenther@suse.de>
PR tree-optimization/67891
* gimple-match.h (gimple_simplified_result_is_gimple_val):
New helper.
(gimple_resimplify1): Declare.
(gimple_resimplify2): Likewise.
(gimple_resimplify3): Likewise.
* gimple-match-head.c (gimple_resimplify1): Export.
(gimple_resimplify2): Likewise.
(gimple_resimplify3): Likewise.
(maybe_push_res_to_seq): Use gimple_simplified_result_is_gimple_val.
* gimple-fold.c (gimple_fold_stmt_to_constant_1): Likewise.
* tree-ssa-sccvn.c (visit_reference_op_load): Use gimple_resimplify1
to avoid creating stmts without VN info.
* gcc.dg/tree-ssa/pr67891.c: New testcase.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@228635 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/gimple-match.h')
-rw-r--r-- | gcc/gimple-match.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/gcc/gimple-match.h b/gcc/gimple-match.h index 4663a34b8f9..632e9a53d1c 100644 --- a/gcc/gimple-match.h +++ b/gcc/gimple-match.h @@ -40,10 +40,28 @@ private: int rep; }; +/* Return whether OPS[0] with CODE is a non-expression result and + a gimple value. */ + +inline bool +gimple_simplified_result_is_gimple_val (code_helper code, tree *ops) +{ + return (code.is_tree_code () + && (TREE_CODE_LENGTH ((tree_code) code) == 0 + || ((tree_code) code) == ADDR_EXPR) + && is_gimple_val (ops[0])); +} + extern tree (*mprts_hook) (code_helper, tree, tree *); bool gimple_simplify (gimple *, code_helper *, tree *, gimple_seq *, tree (*)(tree), tree (*)(tree)); +bool gimple_resimplify1 (gimple_seq *, code_helper *, tree, tree *, + tree (*)(tree)); +bool gimple_resimplify2 (gimple_seq *, code_helper *, tree, tree *, + tree (*)(tree)); +bool gimple_resimplify3 (gimple_seq *, code_helper *, tree, tree *, + tree (*)(tree)); tree maybe_push_res_to_seq (code_helper, tree, tree *, gimple_seq *, tree res = NULL_TREE); void maybe_build_generic_op (enum tree_code, tree, tree *, tree, tree); |