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>