Skip to content
Snippets Groups Projects
Commit c33d8c55 authored by Richard Biener's avatar Richard Biener Committed by Richard Biener
Browse files

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.
parent 9263523b
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment