diff options
author | Richard Sandiford <richard.sandiford@linaro.org> | 2018-05-17 10:51:42 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@gcc.gnu.org> | 2018-05-17 10:51:42 +0000 |
commit | eb69361d0c5e98423e7ad7a537bc3250e083de4a (patch) | |
tree | 6167d8b0e00393370c16fa3632d0a6e8cb756eb6 /gcc/gimple-match-head.c | |
parent | 40659769b2b49e5ebea3ceee26ee73bdc0ff1efc (diff) |
Allow gimple_build with internal functions
This patch makes the function versions of gimple_build and
gimple_simplify take combined_fns rather than built_in_codes,
so that they work with internal functions too. The old
gimple_builds were unused, so no existing callers need
to be updated.
2018-05-17 Richard Sandiford <richard.sandiford@linaro.org>
gcc/
* gimple-fold.h (gimple_build): Make the function forms take
combined_fn rather than built_in_function.
(gimple_simplify): Likewise.
* gimple-match-head.c (gimple_simplify): Likewise.
* gimple-fold.c (gimple_build): Likewise.
* tree-vect-loop.c (get_initial_def_for_reduction): Use gimple_build
rather than gimple_build_call_internal.
(get_initial_defs_for_reduction): Likewise.
(vect_create_epilog_for_reduction): Likewise.
(vectorizable_live_operation): Likewise.
From-SVN: r260315
Diffstat (limited to 'gcc/gimple-match-head.c')
-rw-r--r-- | gcc/gimple-match-head.c | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/gcc/gimple-match-head.c b/gcc/gimple-match-head.c index 4266fb3d906..6caf1e18c24 100644 --- a/gcc/gimple-match-head.c +++ b/gcc/gimple-match-head.c @@ -478,55 +478,53 @@ gimple_simplify (enum tree_code code, tree type, return maybe_push_res_to_seq (rcode, type, ops, seq); } -/* Builtin function with one argument. */ +/* Builtin or internal function with one argument. */ tree -gimple_simplify (enum built_in_function fn, tree type, +gimple_simplify (combined_fn fn, tree type, tree arg0, gimple_seq *seq, tree (*valueize)(tree)) { if (constant_for_folding (arg0)) { - tree res = fold_const_call (as_combined_fn (fn), type, arg0); + tree res = fold_const_call (fn, type, arg0); if (res && CONSTANT_CLASS_P (res)) return res; } code_helper rcode; tree ops[3] = {}; - if (!gimple_simplify (&rcode, ops, seq, valueize, - as_combined_fn (fn), type, arg0)) + if (!gimple_simplify (&rcode, ops, seq, valueize, fn, type, arg0)) return NULL_TREE; return maybe_push_res_to_seq (rcode, type, ops, seq); } -/* Builtin function with two arguments. */ +/* Builtin or internal function with two arguments. */ tree -gimple_simplify (enum built_in_function fn, tree type, +gimple_simplify (combined_fn fn, tree type, tree arg0, tree arg1, gimple_seq *seq, tree (*valueize)(tree)) { if (constant_for_folding (arg0) && constant_for_folding (arg1)) { - tree res = fold_const_call (as_combined_fn (fn), type, arg0, arg1); + tree res = fold_const_call (fn, type, arg0, arg1); if (res && CONSTANT_CLASS_P (res)) return res; } code_helper rcode; tree ops[3] = {}; - if (!gimple_simplify (&rcode, ops, seq, valueize, - as_combined_fn (fn), type, arg0, arg1)) + if (!gimple_simplify (&rcode, ops, seq, valueize, fn, type, arg0, arg1)) return NULL_TREE; return maybe_push_res_to_seq (rcode, type, ops, seq); } -/* Builtin function with three arguments. */ +/* Builtin or internal function with three arguments. */ tree -gimple_simplify (enum built_in_function fn, tree type, +gimple_simplify (combined_fn fn, tree type, tree arg0, tree arg1, tree arg2, gimple_seq *seq, tree (*valueize)(tree)) { @@ -534,7 +532,7 @@ gimple_simplify (enum built_in_function fn, tree type, && constant_for_folding (arg1) && constant_for_folding (arg2)) { - tree res = fold_const_call (as_combined_fn (fn), type, arg0, arg1, arg2); + tree res = fold_const_call (fn, type, arg0, arg1, arg2); if (res && CONSTANT_CLASS_P (res)) return res; } @@ -542,7 +540,7 @@ gimple_simplify (enum built_in_function fn, tree type, code_helper rcode; tree ops[3] = {}; if (!gimple_simplify (&rcode, ops, seq, valueize, - as_combined_fn (fn), type, arg0, arg1, arg2)) + fn, type, arg0, arg1, arg2)) return NULL_TREE; return maybe_push_res_to_seq (rcode, type, ops, seq); } |