On Wed, Aug 21, 2019 at 5:53 PM Jeff Law wrote:
>
> On 8/21/19 7:57 AM, Wilco Dijkstra wrote:
> > Hi Richard,
> >
> >>>
> >>> I think this should be in expand stage where there could be comparison
> >>> of the cost of the RTLs.
> >>
> >> I tend to agree here, if not then for the reason the "simpli
On 8/21/19 7:57 AM, Wilco Dijkstra wrote:
> Hi Richard,
>
>>>
>>> I think this should be in expand stage where there could be comparison
>>> of the cost of the RTLs.
>>
>> I tend to agree here, if not then for the reason the "simplified" variants
>> have more GIMPLE stmts which means they are not
Hi Richard,
> >
> > I think this should be in expand stage where there could be comparison
> > of the cost of the RTLs.
>
> I tend to agree here, if not then for the reason the "simplified" variants
> have more GIMPLE stmts which means they are not "simpler". In
> fact I'd argue for canonicaliza
On Tue, Aug 13, 2019 at 6:47 PM Andrew Pinski wrote:
>
> On Tue, Aug 13, 2019 at 8:50 AM Wilco Dijkstra wrote:
> >
> > Add simplifications for popcount (x) > 1 to (x & (x-1)) != 0 and
> > popcount (x) == 1 into (x-1) > single-use cases and support an optional convert. A microbenchmark
> > shows
On Tue, Aug 13, 2019 at 8:50 AM Wilco Dijkstra wrote:
>
> Add simplifications for popcount (x) > 1 to (x & (x-1)) != 0 and
> popcount (x) == 1 into (x-1) single-use cases and support an optional convert. A microbenchmark
> shows a speedup of 2-2.5x on both x64 and AArch64.
>
> Bootstrap OK, OK f
On Tue, 13 Aug 2019, Wilco Dijkstra wrote:
Add simplifications for popcount (x) > 1 to (x & (x-1)) != 0 and
popcount (x) == 1 into (x-1)
Is that true even on targets that have a popcount instruction? (-mpopcnt
for x64)
diff --git a/gcc/match.pd b/gcc/match.pd
index
0317bc704f771f626ab7218
Add simplifications for popcount (x) > 1 to (x & (x-1)) != 0 and
popcount (x) == 1 into (x-1)
gcc/
PR middle-end/90693
* match.pd: Add popcount simplifications.
testsuite/
PR middle-end/90693
* gcc.dg/fold-popcount-5.c: Add new test.
---
diff --git a/gcc/match.p