]> git.ipfire.org Git - thirdparty/gcc.git/commit
cselim: Handle clobbers too [PR122178]
authorAndrew Pinski <andrew.pinski@oss.qualcomm.com>
Mon, 13 Oct 2025 23:35:07 +0000 (16:35 -0700)
committerAndrew Pinski <andrew.pinski@oss.qualcomm.com>
Tue, 14 Oct 2025 06:46:11 +0000 (23:46 -0700)
commit05393afc13706fd8db35729398f2017d5feff3c8
treec890c4389922c2a75baa76f8f96b03eddbec1bd5
parentd4d64838aef1b37a3e7d85135fcaa9845c5ff54b
cselim: Handle clobbers too [PR122178]

With the addition of cselim-limited in phiopt, factoring
out clobbers can be added easily. Now sink handles clobbers as
a store too. So this just moves that earlier.

This adds support there with a testcase to show it happens.

Bootstrapped and tested on x86_64-linux-gnu.

PR tree-optimization/122178

gcc/ChangeLog:

* tree-ssa-phiopt.cc (cond_if_else_store_replacement_1): Handle
clobber statements.

gcc/testsuite/ChangeLog:

* g++.dg/tree-ssa/cselim-1.C: New test.

Signed-off-by: Andrew Pinski <andrew.pinski@oss.qualcomm.com>
gcc/testsuite/g++.dg/tree-ssa/cselim-1.C [new file with mode: 0644]
gcc/tree-ssa-phiopt.cc