This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [tree-ssa] Simple value range propagation for tree-ssa-dom
- From: law at redhat dot com
- To: Andrew Haley <aph at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Wed, 01 Oct 2003 11:44:06 -0600
- Subject: Re: [tree-ssa] Simple value range propagation for tree-ssa-dom
- Reply-to: law at redhat dot com
In message <16250.46575.720716.405975@cuddles.cambridge.redhat.com>, Andrew Hal
ey writes:
>I was hoping that this would cause redundant checks like this to be
>removed:
>
>int a[10];
>
>int foo ()
>{
> int j;
> int m=0;
> for (j=0; j<10;j++)
> {
> if (j < 0)
> abort();
> if (j > 10)
> abort();
> m+=a[j];
> }
> return m;
>}
We don't currently merge ranges at PHI nodes, nor do we track ranges for
outputs of statements within a basic block. To optimize a loop like that
we have to merge ranges as PHI nodes and possibly look at statemetns within
blocks to build ranges for their outputs.
It's on the todo list, but it's after some other (non-VRP) work.
jeff