This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH][GCC] Algorithmic optimization in match and simplify
- From: Marc Glisse <marc dot glisse at inria dot fr>
- To: Andre Vieira <Andre dot SimoesDiasVieira at arm dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 28 Aug 2015 20:07:04 +0200 (CEST)
- Subject: Re: [PATCH][GCC] Algorithmic optimization in match and simplify
- Authentication-results: sourceware.org; auth=none
- References: <55E092D9 dot 8070700 at arm dot com>
- Reply-to: GCC Patches <gcc-patches at gcc dot gnu dot org>
(not a review, I haven't even read the whole patch)
On Fri, 28 Aug 2015, Andre Vieira wrote:
2015-08-03 Andre Vieira <andre.simoesdiasvieira@arm.com>
* match.pd: Added new patterns:
((X {&,<<,>>} C0) {|,^} C1) {^,|} C2)
(X {|,^,&} C0) {<<,>>} C1 -> (X {<<,>>} C1) {|,^,&} (C0 {<<,>>} C1)
+(for op0 (rshift rshift lshift lshift bit_and bit_and)
+ op1 (bit_ior bit_xor bit_ior bit_xor bit_ior bit_xor)
+ op2 (bit_xor bit_ior bit_xor bit_ior bit_xor bit_ior)
You can nest for-loops, it seems clearer as:
(for op0 (rshift lshift bit_and)
(for op1 (bit_ior bit_xor)
op2 (bit_xor bit_ior)
+(simplify
+ (op2:c
+ (op1:c
+ (op0 @0 INTEGER_CST@1) INTEGER_CST@2) INTEGER_CST@3)
I suspect you will want more :s (single_use) and less :c (canonicalization
should put constants in second position).
+ C1 = wi::bit_and_not (C1,C2);
Space after ','.
Having wide_int_storage in many places is surprising, I can't find similar
code anywhere else in gcc.
--
Marc Glisse