projects
/
gcc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
167ab4b
)
Optimize or+and+or pattern to and+or
author
Eugene Rozenfeld
<Eugene.Rozenfeld@microsoft.com>
Mon, 30 Nov 2020 16:48:58 +0000
(09:48 -0700)
committer
Jeff Law
<law@redhat.com>
Mon, 30 Nov 2020 16:48:58 +0000
(09:48 -0700)
gcc/
PR tree-optimization/96679
* match.pd (((b | c) & a) | b -> (a & c) | b): New pattern.
gcc/match.pd
patch
|
blob
|
history
diff --git
a/gcc/match.pd
b/gcc/match.pd
index 1726c186daabf59af49fd177b0f32f2e1d256d68..6cf16c670099963da3ce1285374700d160cb05e5 100644
(file)
--- a/
gcc/match.pd
+++ b/
gcc/match.pd
@@
-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)