This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Context dependent expression simplification
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Paulo Matos <pmatos at broadcom dot com>
- Cc: "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>
- Date: Tue, 14 Jan 2014 14:45:26 +0100
- Subject: Re: Context dependent expression simplification
- Authentication-results: sourceware.org; auth=none
- References: <19EB96622A777C4AB91610E763265F463E9C71 at SJEXCHMB14 dot corp dot ad dot broadcom dot com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
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.
Jakub