diff options
author | Tamar Christina <tamar.christina@arm.com> | 2023-10-23 14:07:20 +0100 |
---|---|---|
committer | Tamar Christina <tamar.christina@arm.com> | 2023-10-23 14:08:10 +0100 |
commit | 9ed6b22eb4188c57bb3f5cdba5a7effa95395186 (patch) | |
tree | dffd3190a6facf4264f0c61ce49a4b11f831a60a /libcpp | |
parent | 1acd4576435974f36dc91a8cc707cdcdccd049be (diff) | |
download | gcc-9ed6b22eb4188c57bb3f5cdba5a7effa95395186.zip gcc-9ed6b22eb4188c57bb3f5cdba5a7effa95395186.tar.gz gcc-9ed6b22eb4188c57bb3f5cdba5a7effa95395186.tar.bz2 |
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.
Diffstat (limited to 'libcpp')
0 files changed, 0 insertions, 0 deletions