]> git.ipfire.org Git - thirdparty/gcc.git/commit
phiprop: Allow non-trapping loads to be proped back into the loop
authorAndrew Pinski <andrew.pinski@oss.qualcomm.com>
Fri, 21 Nov 2025 06:39:48 +0000 (22:39 -0800)
committerAndrew Pinski <andrew.pinski@oss.qualcomm.com>
Mon, 24 Nov 2025 17:31:09 +0000 (09:31 -0800)
commit952e145796da0f4dc96c42fdcabd75c8293d516c
tree4a029e937ccef0d9256925d2f10cb1b4307bb668
parent789ff802b5765949cc05c609fe6bafaf70880b8d
phiprop: Allow non-trapping loads to be proped back into the loop

First the testcase for PR60183 is no longer testing that we don't
prop into the loops for possible trapping cases. This adds phiprop-4.c
that tests that.
Second we can prop back into loops if we know the load will not trap.
This adds that check. phiprop-3.c tests that.

Bootstrapped and tested on x86_64-linux-gnu.

PR tree-optimization/60183

gcc/ChangeLog:

* tree-ssa-phiprop.cc (propagate_with_phi): Allow
known non-trapping loads to happen back into the
loop.

gcc/testsuite/ChangeLog:

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

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