Commit 2071f8f9 by Naveen H.S Committed by Naveen H.S

match.pd (((m1 >/</>=/<= m2) * d -> (m1 >/</>=/<= m2) ? d : 0): New pattern.

gcc
	* match.pd (((m1 >/</>=/<= m2) * d -> (m1 >/</>=/<= m2) ? d : 0):
	New pattern.

gcc/testsuite
	* gcc.dg/tree-ssa/vrp116.c: New Test.

From-SVN: r250377
parent b882559a
2017-07-20 Naveen H.S <Naveen.Hurugalawadi@cavium.com>
* match.pd (((m1 >/</>=/<= m2) * d -> (m1 >/</>=/<= m2) ? d : 0):
New pattern.
2017-07-19 Jan Hubicka <hubicka@ucw.cz> 2017-07-19 Jan Hubicka <hubicka@ucw.cz>
PR middle-end/81331 PR middle-end/81331
......
...@@ -1089,6 +1089,12 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT) ...@@ -1089,6 +1089,12 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
&& tree_nop_conversion_p (type, TREE_TYPE (@1))) && tree_nop_conversion_p (type, TREE_TYPE (@1)))
(convert (bit_and (bit_not @1) @0)))) (convert (bit_and (bit_not @1) @0))))
/* (m1 CMP m2) * d -> (m1 CMP m2) ? d : 0 */
(for cmp (gt lt ge le)
(simplify
(mult (convert (cmp @0 @1)) @2)
(cond (cmp @0 @1) @2 { build_zero_cst (type); })))
/* For integral types with undefined overflow and C != 0 fold /* For integral types with undefined overflow and C != 0 fold
x * C EQ/NE y * C into x EQ/NE y. */ x * C EQ/NE y * C into x EQ/NE y. */
(for cmp (eq ne) (for cmp (eq ne)
......
2017-07-20 Naveen H.S <Naveen.Hurugalawadi@cavium.com>
* gcc.dg/tree-ssa/vrp116.c: New Test.
2017-07-19 Michael Meissner <meissner@linux.vnet.ibm.com> 2017-07-19 Michael Meissner <meissner@linux.vnet.ibm.com>
* gcc.target/powerpc/cpu-builtin-1.c: Change test to use #ifdef * gcc.target/powerpc/cpu-builtin-1.c: Change test to use #ifdef
......
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-vrp1" } */
int
f (int m1, int m2, int c)
{
int d = m1 > m2;
int e = d * c;
return e ? m1 : m2;
}
/* { dg-final { scan-tree-dump-times "\\? c_\[0-9\]\\(D\\) : 0" 1 "vrp1" } } */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment