This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
RE: Context dependent expression simplification
- From: Paulo Matos <pmatos at broadcom dot com>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>
- Date: Tue, 14 Jan 2014 13:48:38 +0000
- Subject: RE: Context dependent expression simplification
- Authentication-results: sourceware.org; auth=none
- References: <19EB96622A777C4AB91610E763265F463E9C71 at SJEXCHMB14 dot corp dot ad dot broadcom dot com> <20140114134526 dot GN892 at tucnak dot redhat dot com>
> -----Original Message-----
> From: Jakub Jelinek [mailto:jakub@redhat.com]
> Sent: 14 January 2014 13:45
> To: Paulo Matos
> Cc: gcc@gcc.gnu.org
> Subject: Re: Context dependent expression simplification
>
> On Tue, Jan 14, 2014 at 01:40:36PM +0000, Paulo Matos wrote:
> > Before I start to write code to reinvent the wheel, I would like to know if
> there's something already out there to do context dependent expression
> simplification.
> > What I need is to simplify an expression at a given point in a BB.
> >
> > For example:
> >
> > bb2:
> > r1 <- 2
> > if r2 != 0 goto bb3 else bb4
> > bb3:
> > r3 <- r2 << 1
> > goto bb4
> > bb4:
> > ...
> > ...
> > if ... goto bb4 else bb5
> >
> > Is there any way already implemented to find the value of (and (plus r1 r3)
> (const_int 1)) at the end of bb4 and simplify it to (const_int 0)?
>
> VRP should handle this (of course at the GIMPLE level) performs context
> dependent optimizations through it's edge assertions.
I need to do this during loop_doloop to simplify infinite conditons.
Might have to implement something to do this at RTL level then.
Paulo Matos
>
> Jakub