This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: RFC: Gimple combine/folding interface
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Jeff Law <law at redhat dot com>
- Cc: Andrew Pinski <pinskia at gmail dot com>, GCC Mailing List <gcc at gcc dot gnu dot org>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 22 Jul 2013 21:48:22 +0200
- Subject: Re: RFC: Gimple combine/folding interface
- References: <CA+=Sn1nvR6qb-Z_qaY008wm-8viVgvQx_1d_F7S+7LvnFS+tsg at mail dot gmail dot com> <CA+=Sn1kawphy0cwLJE+TS8qRoazicU5F9uAxC7-Z5MFOtxm2HQ at mail dot gmail dot com> <51ED89B1 dot 908 at redhat dot com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Mon, Jul 22, 2013 at 01:36:17PM -0600, Jeff Law wrote:
> Before designing an interface which inherently includes that
> information we should think hard about if it's valuable and if a
> tree combiner is the right place.
>
> I have high hopes that we can get the zero/sign extension
> elimination we want by carrying VRP information and querying it.
>
> As Richi has mentioned, we really want a folder we can call
> independently of whatever pass we're in. Though I'd also like a
> folder that can query for pass specific information if it's handy
> and useful.
For the preservation of VRP info we already have patch in process of review:
http://gcc.gnu.org/ml/gcc-patches/2013-07/msg00121.html
As for zero bits info, I've recently run into a case where having the zero
bits information preserved alongside of the VRP info could be helpful,
for optimizing away the vectorizer scalar loop for bound. If non-zero bits
computation proves or e.g. user asserts through if (val % 32)
__builtin_unreachable () or similar, even when the bounds of the loop aren't
constant, we could figure out that the number of iterations is a multiply of
vectorization factor and avoid computing that
So, perhaps let vrp{1,2} compute the vrp info and preserve (plus if not
specified just set nonzero bits to all ones), and this pass or other compute
the nonzero bits? Sign bit copies is just an int, perhaps also track that.
Jakub