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: Richard Biener <richard dot guenther at gmail dot com>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Cc: "Hurugalawadi, Naveen" <Naveen dot Hurugalawadi at caviumnetworks dot com>
- Date: Tue, 13 Oct 2015 14:50:39 +0200
- 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> <alpine dot DEB dot 2 dot 20 dot 1510131413240 dot 2213 at laptop-mg dot saclay dot inria dot fr>
On Tue, Oct 13, 2015 at 2:18 PM, Marc Glisse <marc.glisse@inria.fr> wrote:
> 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...
Sorry, your comments are of course correct. Neveen, please adjust
also according
to these comments.
Richard.
> --
> Marc Glisse