Re: Looking for the name of an optimization

"Diego Novillo" <dnovillo@acm.org>
Mon, 31 Mar 2008 21:16:37 -0400

          From comp.compilers

Related articles
Looking for the name of an optimization ccox@comcast.net (Chris Cox) (2008-03-31)
Re: Looking for the name of an optimization dnovillo@acm.org (Diego Novillo) (2008-03-31)
Re: Looking for the name of an optimization cfc@shell01.TheWorld.com (Chris F Clark) (2008-04-02)
Re: Looking for the name of an optimization andreybokhanko@gmail.com (2008-04-13)
| List of all articles for this month |
From: "Diego Novillo" <dnovillo@acm.org>
Newsgroups: comp.compilers
Date: Mon, 31 Mar 2008 21:16:37 -0400
Organization: Compilers Central
References: 08-03-123
Keywords: optimize
Posted-Date: 31 Mar 2008 22:20:27 EDT

On Mon, Mar 31, 2008 at 8:36 PM, Chris Cox <ccox@comcast.net> wrote:


> if (x == 1 && y == 2)
> z = 300 / (x + y)
> ==>
> if (x == 1 && y == 2)
> z = 100


In GCC we call it VRP, value range propagation.


It falls out of the singularity that happens when you have ranges
where min == max: In this case, inside the then clause of that if(),
the range for x is [1, 1], the range for y is [2, 2]. After
propagation, GCC substitutes x with 1, y with 2 and the folders do the
rest.




Diego.


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.