Optimize or+and+or pattern to and+or

gcc/
	PR tree-optimization/96679
	* match.pd (((b | c) & a) | b -> (a & c) | b): New pattern.
This commit is contained in:
Eugene Rozenfeld 2020-11-30 09:48:58 -07:00 committed by Jeff Law
parent 167ab4b153
commit 28a7fdd81e

View File

@ -1460,6 +1460,11 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
(bitop:c (rbitop:c (bit_not @0) @1) @0)
(bitop @0 @1)))
/* ((x | y) & z) | x -> (z & y) | x */
(simplify
(bit_ior:c (bit_and:cs (bit_ior:cs @0 @1) @2) @0)
(bit_ior (bit_and @2 @1) @0))
/* (x | CST1) & CST2 -> (x & CST2) | (CST1 & CST2) */
(simplify
(bit_and (bit_ior @0 CONSTANT_CLASS_P@1) CONSTANT_CLASS_P@2)