> Am 31.05.2025 um 18:29 schrieb Andrew Pinski <quic_apin...@quicinc.com>:
>
> SSA form is kept up to date except for VOPs when CFG was removed
> so only set update ssa TODO if the CFG has changed. This is still
> sets the TODO in more cases than it is needed but it reduces enough
> to make difference.
>
> Bootstrappd and tested on x86_64-linux-gnu.
>
> gcc/ChangeLog:
>
> * tree-ssa-dce.cc (perform_tree_ssa_dce): Set TODO_update_ssa
> only when cfg has changed
>
> Signed-off-by: Andrew Pinski <quic_apin...@quicinc.com>
> ---
> gcc/tree-ssa-dce.cc | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/gcc/tree-ssa-dce.cc b/gcc/tree-ssa-dce.cc
> index ba9cd6536ae..f5e67c4409a 100644
> --- a/gcc/tree-ssa-dce.cc
> +++ b/gcc/tree-ssa-dce.cc
> @@ -2167,7 +2167,11 @@ perform_tree_ssa_dce (bool aggressive)
> free_numbers_of_iterations_estimates (cfun);
> if (in_loop_pipeline)
> scev_reset ();
> - todo |= TODO_update_ssa | TODO_cleanup_cfg;
> + todo |= TODO_cleanup_cfg;
> + /* If the cfg has been modified, then there might
> + have been virtual op that needs to be updated. */
> + if (cfg_altered)
> + todo |= TODO_update_ssa;
I believe this is due to LC SSA, so only necessary when in loop pipeline.
TODO_update_SSA is free when there’s nothing to do, so I can’t see how it makes
a difference? Does it because LC SSA rewrite isn’t cheap?
> }
> return todo;
> }
> --
> 2.43.0
>