This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] [Match & Simplify] Optimize some minmax patterns
- From: Richard Biener <richard dot guenther at gmail dot com>
- To: "Hurugalawadi, Naveen" <Naveen dot Hurugalawadi at cavium dot com>
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, "Pinski, Andrew" <Andrew dot Pinski at cavium dot com>, "marc dot glisse at inria dot fr" <marc dot glisse at inria dot fr>
- Date: Fri, 16 Dec 2016 14:25:30 +0100
- Subject: Re: [PATCH] [Match & Simplify] Optimize some minmax patterns
- Authentication-results: sourceware.org; auth=none
- References: <CO2PR07MB269402165A70BA41A32350A6839D0@CO2PR07MB2694.namprd07.prod.outlook.com>
On Thu, Dec 15, 2016 at 12:01 PM, Hurugalawadi, Naveen
<Naveen.Hurugalawadi@cavium.com> wrote:
> Hi,
>
> Please find attached the patch that optimizes some patterns
> in maxmin on same variabes with constants.
>
> Bootstrapped and Regression tested on x86_64 & aarch64-thunder-linux.
>
> Please review the patch and let us know if its okay?
Please put the patterns after the initial trivial ones, for example
after
(simplify
(max @0 @1)
(switch
(if (INTEGRAL_TYPE_P (type)
&& TYPE_MAX_VALUE (type)
&& operand_equal_p (@1, TYPE_MAX_VALUE (type), OEP_ONLY_CONST))
@1)
(if (INTEGRAL_TYPE_P (type)
&& TYPE_MIN_VALUE (type)
&& operand_equal_p (@1, TYPE_MIN_VALUE (type), OEP_ONLY_CONST))
@0)))
ok with that change.
RIchard.
> 2016-12-15 Andrew Pinski <apinski@cavium.com>
> Naveen H.S <Naveen.Hurugalawadi@cavium.com>
> gcc
> * match.pd (max:c @0 (plus@2 @0 INTEGER_CST@1)): New Pattern.
> (min:c @0 (plus@2 @0 INTEGER_CST@1)) : New Pattern.
> gcc/testsuite
> * gcc.dg/max.c: New Testcase.
> * gcc.dg/min.c: New Testcase.
>
>