]> gcc.gnu.org Git - gcc.git/commit
middle-end: don't keep .MEM guard nodes for PHI nodes who dominate loop [PR111860]
authorTamar Christina <tamar.christina@arm.com>
Mon, 23 Oct 2023 13:07:20 +0000 (14:07 +0100)
committerTamar Christina <tamar.christina@arm.com>
Mon, 23 Oct 2023 13:08:10 +0000 (14:08 +0100)
commit9ed6b22eb4188c57bb3f5cdba5a7effa95395186
treedffd3190a6facf4264f0c61ce49a4b11f831a60a
parent1acd4576435974f36dc91a8cc707cdcdccd049be
middle-end: don't keep .MEM guard nodes for PHI nodes who dominate loop [PR111860]

The previous patch tried to remove PHI nodes that dominated the first loop,
however the correct fix is to only remove .MEM nodes.

This patch thus makes the condition a bit stricter and only tries to remove
MEM phi nodes.

I couldn't figure out a way to easily determine if a particular PHI is vUSE
related, so the patch does:

1. check if the definition is a vDEF and not defined in main loop.
2. check if the definition is a PHI and not defined in main loop.
3. check if the definition is a default definition.

For no 2 and 3 we may misidentify the PHI, in both cases the value is defined
outside of the loop version block which also makes it ok to remove.

gcc/ChangeLog:

PR tree-optimization/111860
* tree-vect-loop-manip.cc (slpeel_tree_duplicate_loop_to_edge_cfg):
Drop .MEM nodes only.

gcc/testsuite/ChangeLog:

PR tree-optimization/111860
* gcc.dg/vect/pr111860-2.c: New test.
* gcc.dg/vect/pr111860-3.c: New test.
gcc/testsuite/gcc.dg/vect/pr111860-2.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/vect/pr111860-3.c [new file with mode: 0644]
gcc/tree-vect-loop-manip.cc
This page took 0.072858 seconds and 5 git commands to generate.