diff options
author | Richard Biener <rguenther@suse.de> | 2024-10-21 14:01:23 +0200 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2024-10-22 09:57:34 +0200 |
commit | c33d8c55a79f08e4a14b4bc601b270268d3c4c89 (patch) | |
tree | 8e066736de4fd88c7a8bfc683de579183c04e644 /gcc/fortran | |
parent | 9263523b7e522e5b8c9ac70df5efc73632c19380 (diff) | |
download | gcc-c33d8c55a79f08e4a14b4bc601b270268d3c4c89.zip gcc-c33d8c55a79f08e4a14b4bc601b270268d3c4c89.tar.gz gcc-c33d8c55a79f08e4a14b4bc601b270268d3c4c89.tar.bz2 |
tree-optimization/117123 - missed PHI equivalence in VN
Value-numbering can use its set of equivalences to prove that
a PHI node with args <a_1, 5, 10> is equal to a_1 iff on the
edges with the constants a_1 == 5 and a_1 == 10 hold. This
breaks down when the order of PHI args is <5, 10, a_1> as then
we drop to VARYING early. The following mitigates this by
shuffling a copy of the edge vector to always process a SSA name
argument first. Which should also handle the special-case of
a two argument <5, a_1> we already had.
PR tree-optimization/117123
* tree-ssa-sccvn.cc (visit_phi): First process a non-constant
argument edge to handle more equivalences. Remove the
two-arg special case.
* g++.dg/tree-ssa/pr117123.C: New testcase.
Diffstat (limited to 'gcc/fortran')
0 files changed, 0 insertions, 0 deletions