]> git.ipfire.org Git - thirdparty/gcc.git/commit
phiprop: allowing prop into loop if there is a phi already
authorAndrew Pinski <andrew.pinski@oss.qualcomm.com>
Fri, 21 Nov 2025 07:14:24 +0000 (23:14 -0800)
committerAndrew Pinski <andrew.pinski@oss.qualcomm.com>
Mon, 24 Nov 2025 17:31:09 +0000 (09:31 -0800)
commite94e91d6f37750cae671ea7f82ce55bda3f8f372
tree8bcc252cbacefac979ee184e18f01a3929cfb050
parent952e145796da0f4dc96c42fdcabd75c8293d516c
phiprop: allowing prop into loop if there is a phi already

This is a small improvement over the original change
for PR60183 where if we created a phi already we can
reuse it always but since the order of this use might
be before the use which was valid to transform. we
need a vector to save the delayed ones.

Bootstrapped and tested on x86_64-linux-gnu.

PR tree-optimization/60183

gcc/ChangeLog:

* tree-ssa-phiprop.cc (propagate_with_phi): Delay the decision
of always rejecting proping into the loop until all are done.
if there was some delay stmts and a phi was created fill them in.

gcc/testsuite/ChangeLog:

* gcc.dg/tree-ssa/phiprop-5.c: New test.

Signed-off-by: Andrew Pinski <andrew.pinski@oss.qualcomm.com>
gcc/testsuite/gcc.dg/tree-ssa/phiprop-5.c [new file with mode: 0644]
gcc/tree-ssa-phiprop.cc