This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: advanced value range propagation for tree-ssa
- From: "Daniel Berlin" <dberlin at dberlin dot org>
- To: "zhouyi zhou" <zhouzhouyi at gmail dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Sat, 15 Mar 2008 23:41:11 -0400
- Subject: Re: advanced value range propagation for tree-ssa
- References: <1205565704.14045.ezmlm@gcc.gnu.org> <20080315155725.20cf482c.zhouzhouyi@gmail.com>
On Sat, Mar 15, 2008 at 3:57 AM, zhouyi zhou <zhouzhouyi@gmail.com> wrote:
> High,
> Currently gcc can optimize following program by threading a block:
> int
> fn(int s, int w) {
> int i;
>
> i = 2;
>
> if (s)
> i = 1;
>
> if (s)
> printf("%d\n", i);
>
> return 0;
> }
>
> While it cannot handle programs of following kind:
> int
> fn(int s, int w) {
> int i;
>
> i = 2;
>
> if (s)
> i = 1;
>
> if (w)
> goto out1;
>
> if (s)
> printf("%d\n", i);
>
> out1:
> return 0;
> }
>
> The advanced value range propagation:
> http://wiki.freebsd.org/ZhouyiZHOU?action=AttachFile&do=get&target=avrp.patch
>
> nicely handles the above case
>
> 2 (if s)
> / \
> 8 3
> \ |
> \__ 4----
> /
> 5(if s)
> / \
> 6 10
>
> The advanced value range propagation
> 1) identify the candidate basic block pairs by
> recurively matching the dom son and dom parent (in our case block 5 and block 2 are
> selected)
> 2) identiy the threadable edge pairs:
> here edge pair 8-4 and 5-6, 3-4 and 5-10 are selected
> 3) thread the edges (duplicate the basic blocks between)
> 2
> / \
> 8 3
> | \
> 4'- 4''-
> | |
> 5' 5''
> / |
> 6 10
>
> The patch is being compiled and bootstraped on i686-linux m-32.
> and passed most of regression test by make -k check (the not passed tests
> are caused the wrong configuration of my machine like libgmp and libmpfr)
>
> The patch is rudimentary and very dirty written currently, I will clean it in the future
>
> Your review and reply are greatly appreciated.
> Zhouyi
> and libmpfr
You didn't svn add tree-avrp.c, so it doesn't appear in the patch :)
>