This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Move some bit and binary optimizations in simplify and match
- From: Marc Glisse <marc dot glisse at inria dot fr>
- To: Richard Biener <richard dot guenther at gmail dot com>
- Cc: "Hurugalawadi, Naveen" <Naveen dot Hurugalawadi at caviumnetworks dot com>, "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 13 Oct 2015 14:18:32 +0200 (CEST)
- Subject: Re: Move some bit and binary optimizations in simplify and match
- Authentication-results: sourceware.org; auth=none
- References: <SN2PR0701MB10242B9E56933B072C29DE698E360 at SN2PR0701MB1024 dot namprd07 dot prod dot outlook dot com> <CAFiYyc0hiJX=Q6q9b4cNBnNXaKWKPkk3tb4gaBZr_m-gU9OjCA at mail dot gmail dot com> <SN2PR0701MB10245F3B91BE5291AD40C1848E310 at SN2PR0701MB1024 dot namprd07 dot prod dot outlook dot com> <CAFiYyc12AuTFeiB5WkQEdzPf_3vSaQyV6UdWsXNSYP8H+91p_g at mail dot gmail dot com> <SN2PR0701MB102426DA4DC98FDCB8428FB28E300 at SN2PR0701MB1024 dot namprd07 dot prod dot outlook dot com> <CAFiYyc3PEDejBG+3kyYoHm2W7tQKmDd+PSw58me4Zjieij2+fg at mail dot gmail dot com>
- Reply-to: gcc-patches at gcc dot gnu dot org
On Tue, 13 Oct 2015, Richard Biener wrote:
+/* Simplify ~X & X as zero. */
+(simplify
+ (bit_and:c (convert? @0) (convert? (bit_not @0)))
+ (if (tree_nop_conversion_p (type, TREE_TYPE (@0)))
The test seems unnecessary for this specific transformation.
+ { build_zero_cst (TREE_TYPE (@0)); }))
I'd rather build_zero_cst (type) directly.
+/* (-A) * (-B) -> A * B */
+(simplify
+ (mult:c (convert? (negate @0)) (convert? negate_expr_p@1))
+ (if (tree_nop_conversion_p (type, TREE_TYPE (@0)))
+ (mult (convert @0) (convert (negate @1)))))
this one is ok with using convert1? and convert2?
Is it? Maybe if it also checked tree_nop_conversion_p for @1...
--
Marc Glisse