diff options
author | Richard Biener <rguenther@suse.de> | 2021-04-14 13:40:58 +0200 |
---|---|---|
committer | Richard Biener <rguenther@suse.de> | 2021-04-26 10:08:46 +0200 |
commit | 52a5515ed6619739eb122f05ce26057dd8b06fb6 (patch) | |
tree | ce23cf5cca7daae1d47e61007eccfdbfe862fe13 /gcc/tree-ssa-dce.c | |
parent | 297bfacdb448c0d29b8dfac2818350b90902bc75 (diff) | |
download | gcc-52a5515ed6619739eb122f05ce26057dd8b06fb6.zip gcc-52a5515ed6619739eb122f05ce26057dd8b06fb6.tar.gz gcc-52a5515ed6619739eb122f05ce26057dd8b06fb6.tar.bz2 |
Simplify {gimplify_and_,}update_call_from_tree API
This removes update_call_from_tree in favor of
gimplify_and_update_call_from_tree, removing some code duplication
and simplifying the API use. Some users of update_call_from_tree
have been transitioned to replace_call_with_value and the API
and its dependences have been moved to gimple-fold.h.
This shaves off another user of valid_gimple_rhs_p which is now
only used from within gimple-fold.c and thus moved and made private.
2021-04-14 Richard Biener <rguenther@suse.de>
* tree-ssa-propagate.h (valid_gimple_rhs_p): Remove.
(update_gimple_call): Likewise.
(update_call_from_tree): Likewise.
* tree-ssa-propagate.c (valid_gimple_rhs_p): Remove.
(valid_gimple_call_p): Likewise.
(move_ssa_defining_stmt_for_defs): Likewise.
(finish_update_gimple_call): Likewise.
(update_gimple_call): Likewise.
(update_call_from_tree): Likewise.
(propagate_tree_value_into_stmt): Use replace_call_with_value.
* gimple-fold.h (update_gimple_call): Declare.
* gimple-fold.c (valid_gimple_rhs_p): Move here from
tree-ssa-propagate.c.
(update_gimple_call): Likewise.
(valid_gimple_call_p): Likewise.
(finish_update_gimple_call): Likewise, and simplify.
(gimplify_and_update_call_from_tree): Implement
update_call_from_tree functionality, avoid excessive
push/pop_gimplify_context.
(gimple_fold_builtin): Use only gimplify_and_update_call_from_tree.
(gimple_fold_call): Likewise.
* gimple-ssa-sprintf.c (try_substitute_return_value): Likewise.
* tree-ssa-ccp.c (ccp_folder::fold_stmt): Likewise.
(pass_fold_builtins::execute): Likewise.
(optimize_stack_restore): Use replace_call_with_value.
* tree-cfg.c (fold_loop_internal_call): Likewise.
* tree-ssa-dce.c (maybe_optimize_arith_overflow): Use
only gimplify_and_update_call_from_tree.
* tree-ssa-strlen.c (handle_builtin_strlen): Likewise.
(handle_builtin_strchr): Likewise.
* tsan.c: Include gimple-fold.h instead of tree-ssa-propagate.h.
* config/rs6000/rs6000-call.c (rs6000_gimple_fold_builtin):
Use replace_call_with_value.
Diffstat (limited to 'gcc/tree-ssa-dce.c')
-rw-r--r-- | gcc/tree-ssa-dce.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/gcc/tree-ssa-dce.c b/gcc/tree-ssa-dce.c index c027230..096cfc8 100644 --- a/gcc/tree-ssa-dce.c +++ b/gcc/tree-ssa-dce.c @@ -1274,8 +1274,7 @@ maybe_optimize_arith_overflow (gimple_stmt_iterator *gsi, fprintf (dump_file, "\n"); } - if (!update_call_from_tree (gsi, result)) - gimplify_and_update_call_from_tree (gsi, result); + gimplify_and_update_call_from_tree (gsi, result); } /* Eliminate unnecessary statements. Any instruction not marked as necessary |