Skip to content
Snippets Groups Projects
Commit d256dc28 authored by Andrew Pinski's avatar Andrew Pinski
Browse files

PHIOPT: Improve replace_phi_edge_with_variable for diamond shapped bb

While looking at differences between what minmax_replacement
and match_simplify_replacement does. I noticed that they sometimes
chose different edges to remove. I decided we should be able to do
better and be able to remove both empty basic blocks in the
case of match_simplify_replacement as that moves the statements.

This also updates the testcases as now match_simplify_replacement
will remove the unused MIN/MAX_EXPR and they were checking for
those.

OK? Bootstrapped and tested on x86_64-linux-gnu with no regressions.

gcc/ChangeLog:

	* tree-ssa-phiopt.cc (replace_phi_edge_with_variable): Handle
	diamond form bb with forwarder only empty blocks better.

gcc/testsuite/ChangeLog:

	* gcc.dg/tree-ssa/minmax-15.c: Update test.
	* gcc.dg/tree-ssa/minmax-16.c: Update test.
	* gcc.dg/tree-ssa/minmax-3.c: Update test.
	* gcc.dg/tree-ssa/minmax-4.c: Update test.
	* gcc.dg/tree-ssa/minmax-5.c: Update test.
	* gcc.dg/tree-ssa/minmax-8.c: Update test.
parent 78b0eea7
No related branches found
No related tags found
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