This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [gsoc 2014] moving fold-const patterns to gimple
- From: Marc Glisse <marc dot glisse at inria dot fr>
- To: Prathamesh Kulkarni <bilbotheelffriend at gmail dot com>
- Cc: Richard Biener <richard dot guenther at gmail dot com>, gcc <gcc at gcc dot gnu dot org>
- Date: Fri, 14 Mar 2014 16:55:06 +0100 (CET)
- Subject: Re: [gsoc 2014] moving fold-const patterns to gimple
- Authentication-results: sourceware.org; auth=none
- References: <CAJXstsDSbO7QTSkJ-y4ftO4SshGkwYuow+U0nb4FdHSjHtfB=A at mail dot gmail dot com> <CAFiYyc0UqPLoV76gUWiUXzCa3SxumXrmq7vsFtJ4GtnNjVrf3A at mail dot gmail dot com> <CAJXstsAAA0=2ELCaai8SdM3e3S1S2hcigUF2A=s0jS-ytwCXdA at mail dot gmail dot com> <CAFiYyc09sUOGGaPzRge6ysr1TzucGCMufFSQbTy5GADXWh5rTg at mail dot gmail dot com> <CAJXstsAuf8PSvbFMudDV43xdJTQ5wxYoiRGO5MJ-u0QCZYVunw at mail dot gmail dot com> <CAFiYyc0k=onaLtokpzsbbHDQ7SvotYdpkuF5z+UyVwC2JhkFnA at mail dot gmail dot com> <CAJXstsCD1EEMKqB19-=7SOrsmQgNFn23+mUe0+S-bPULHLgbXg at mail dot gmail dot com> <CAFiYyc2W7nmYnpBFF-xhO3G4rGzVLXvZoCaRV6UTo_2aZNxuxA at mail dot gmail dot com> <CAFiYyc2WRuH7Am42zBQd2-h6tatsgX8Wn9ECb_b_QNq0FYTA1g at mail dot gmail dot com> <CAJXstsC86wTB6oWdaCqtcR6vP4k4OJu0eAsoTLxsp_iXz48hvg at mail dot gmail dot com>
- Reply-to: gcc at gcc dot gnu dot org
On Fri, 14 Mar 2014, Prathamesh Kulkarni wrote:
I had a look at PR 14753
(http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14753) from the first
link. I have tried to implement those transforms (attached patch,
stage-1 compiled).
I have written the transforms to operate on GENERIC.
Why not directly gimple or the .pd file?
Is that correct ?
The patterns mentioned in the links were:
a) (X >> CST1) >= CST2 -> X >= CST2 << CST1
however, an expression Y >= CST gets folded to Y > CST - 1
so the transform I wrote:
(X >> CST1) > CST2 -> X > CST2 << CST1
That's not the same, try X=1, CST1=1, CST2=0.
b) (X & ~CST) == 0 -> X <= CST
Uh, that can't be true for all constants, only some with a very specific
shape (7 is 2^3-1).
--
Marc Glisse