Skip to content
Snippets Groups Projects
Commit 5eadc673 authored by Eikansh Gupta's avatar Eikansh Gupta Committed by Andrew Pinski
Browse files

MATCH: Simplify `min(a, b) op max(a, b)` to `a op b` [PR109401]


This patch simplify `min(a,b) op max(a,b)` to `a op b`. This optimization
will work for all the binary commutative operations. So, the `op` here can
be one of {plus, mult, bit_and, bit_xor, bit_ior, eq, ne, min, max}.

	PR tree-optimization/109401

gcc/ChangeLog:

	* match.pd (min(a,b) op max(a,b) -> a op b): New pattern.

gcc/testsuite/ChangeLog:

	* gcc.dg/tree-ssa/pr109401.c: New test.
	* gcc.dg/tree-ssa/pr109401-1.c: New test.

Signed-off-by: default avatarEikansh Gupta <quic_eikagupt@quicinc.com>
parent 94bea5dd
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