]> git.ipfire.org Git - thirdparty/gcc.git/commit
fab/forwprop: Move optimize stack restore to forwprop [PR121762]
authorAndrew Pinski <andrew.pinski@oss.qualcomm.com>
Tue, 23 Sep 2025 18:37:35 +0000 (11:37 -0700)
committerAndrew Pinski <andrew.pinski@oss.qualcomm.com>
Fri, 3 Oct 2025 14:28:37 +0000 (07:28 -0700)
commita8326b0c20383b4f10c8a5a3c8c4887fd54d4335
treea151700ecf1d25d8226ea641a8a0ac0827b90647
parent4440e022d220c19358745a1ba7ccf6ae054ce347
fab/forwprop: Move optimize stack restore to forwprop [PR121762]

This moves the removal of redundant stack restore from fab to forwprop.
There is a possibility of removing some of the redundant stack restores
before the last folding but that is for a different patch.

Changes since v1:
* v2: the additional comment change.

Bootstrapped and tested on x86_64-linux-gnu.

PR tree-optimization/121762
gcc/ChangeLog:

* tree-ssa-ccp.cc (optimize_stack_restore): Move to tree-ssa-forwprop.cc.
(pass_fold_builtins::execute): Don't call optimize_stack_restore.
* tree-ssa-forwprop.cc (optimize_stack_restore): New function from
tree-ssa-ccp.cc. Return bool instead of value, use replace_call_with_value
istead of returning integer_zero_node.
(simplify_builtin_call): Call optimize_stack_restore.

Signed-off-by: Andrew Pinski <andrew.pinski@oss.qualcomm.com>
gcc/tree-ssa-ccp.cc
gcc/tree-ssa-forwprop.cc