diff options
author | Li Jia He <helijia@linux.ibm.com> | 2019-09-16 14:21:20 +0000 |
---|---|---|
committer | Martin Liska <marxin@gcc.gnu.org> | 2019-09-16 14:21:20 +0000 |
commit | 5f487a349de62613d7fa429bcbfbeeafbfc94f3a (patch) | |
tree | d63d3e1bb2210eb3e25095d2dc0deab2b5ccf72a /gcc/tree-ssanames.c | |
parent | 10f30ac9cda947d117e50f0cbd4cf94ee70a944f (diff) | |
download | gcc-5f487a349de62613d7fa429bcbfbeeafbfc94f3a.zip gcc-5f487a349de62613d7fa429bcbfbeeafbfc94f3a.tar.gz gcc-5f487a349de62613d7fa429bcbfbeeafbfc94f3a.tar.bz2 |
Auto-generate maybe_fold_and/or_comparisons from match.pd
2019-09-16 Li Jia He <helijia@linux.ibm.com>
Martin Liska <mliska@suse.cz>
* gimple-fold.c (and_comparisons_1): Add type as first
argument.
(and_var_with_comparison): Likewise.
(and_var_with_comparison_1): Likewise.
(or_comparisons_1): Likewise.
(or_var_with_comparison): Likewise.
(or_var_with_comparison_1): Likewise.
(maybe_fold_and_comparisons): Call maybe_fold_comparisons_from_match_pd.
(maybe_fold_or_comparisons): Likewise.
(maybe_fold_comparisons_from_match_pd): New.
* gimple-fold.h (maybe_fold_and_comparisons): Add type argument.
(maybe_fold_or_comparisons): Likewise.
* gimple.c (gimple_size): Make it public and add num_ops argument.
(gimple_init): New function.
(gimple_alloc): Call gimple_init.
* gimple.h (gimple_size): New.
(gimple_init): Likewise.
* tree-if-conv.c (fold_or_predicates): Pass type.
* tree-ssa-ifcombine.c (ifcombine_ifandif): Likewise.
* tree-ssa-reassoc.c (eliminate_redundant_comparison): Likewise.
(optimize_vec_cond_expr): Likewise.
(ovce_extract_ops): Return type of conditional expression.
* tree-ssanames.c (init_ssa_name_imm_use): New.
(make_ssa_name_fn): Use init_ssa_name_imm_use.
* tree-ssanames.h (init_ssa_name_imm_use): New.
Co-Authored-By: Martin Liska <mliska@suse.cz>
From-SVN: r275748
Diffstat (limited to 'gcc/tree-ssanames.c')
-rw-r--r-- | gcc/tree-ssanames.c | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/gcc/tree-ssanames.c b/gcc/tree-ssanames.c index 3911db9..f7b638d 100644 --- a/gcc/tree-ssanames.c +++ b/gcc/tree-ssanames.c @@ -252,6 +252,19 @@ flush_ssaname_freelist (void) vec_safe_truncate (FREE_SSANAMES_QUEUE (cfun), 0); } +/* Initialize SSA_NAME_IMM_USE_NODE of a SSA NAME. */ + +void +init_ssa_name_imm_use (tree name) +{ + use_operand_p imm; + imm = &(SSA_NAME_IMM_USE_NODE (name)); + imm->use = NULL; + imm->prev = imm; + imm->next = imm; + imm->loc.ssa_name = name; +} + /* Return an SSA_NAME node for variable VAR defined in statement STMT in function FN. STMT may be an empty statement for artificial references (e.g., default definitions created when a variable is @@ -263,8 +276,6 @@ make_ssa_name_fn (struct function *fn, tree var, gimple *stmt, unsigned int version) { tree t; - use_operand_p imm; - gcc_assert (VAR_P (var) || TREE_CODE (var) == PARM_DECL || TREE_CODE (var) == RESULT_DECL @@ -318,11 +329,7 @@ make_ssa_name_fn (struct function *fn, tree var, gimple *stmt, SSA_NAME_IN_FREE_LIST (t) = 0; SSA_NAME_IS_DEFAULT_DEF (t) = 0; - imm = &(SSA_NAME_IMM_USE_NODE (t)); - imm->use = NULL; - imm->prev = imm; - imm->next = imm; - imm->loc.ssa_name = t; + init_ssa_name_imm_use (t); return t; } |