Re: A problem about loop store motion

2012-02-22 Thread Richard Guenther
@gmail.com] >> >> Sent: Tuesday, February 21, 2012 5:40 PM >> >> To: Jiangning Liu >> >> Cc: gcc@gcc.gnu.org >> >> Subject: Re: A problem about loop store motion >> >> >> >> On Tue, Feb 21, 2012 at 9:54 AM, Jiangning Liu &g

RE: A problem about loop store motion

2012-02-21 Thread Jiangning Liu
> -Original Message- > From: gcc-ow...@gcc.gnu.org [mailto:gcc-ow...@gcc.gnu.org] On Behalf Of > Richard Guenther > Sent: Tuesday, February 21, 2012 6:19 PM > To: Jiangning Liu > Cc: gcc@gcc.gnu.org > Subject: Re: A problem about loop store motion > > On Tu

Re: A problem about loop store motion

2012-02-21 Thread Richard Guenther
On Tue, Feb 21, 2012 at 10:57 AM, Jiangning Liu wrote: > > >> -Original Message- >> From: Richard Guenther [mailto:richard.guent...@gmail.com] >> Sent: Tuesday, February 21, 2012 5:40 PM >> To: Jiangning Liu >> Cc: gcc@gcc.gnu.org >> Subject: Re:

RE: A problem about loop store motion

2012-02-21 Thread Jiangning Liu
> -Original Message- > From: Richard Guenther [mailto:richard.guent...@gmail.com] > Sent: Tuesday, February 21, 2012 5:40 PM > To: Jiangning Liu > Cc: gcc@gcc.gnu.org > Subject: Re: A problem about loop store motion > > On Tue, Feb 21, 2012 at 9:54 AM, Jiangnin

Re: A problem about loop store motion

2012-02-21 Thread Richard Guenther
On Tue, Feb 21, 2012 at 9:54 AM, Jiangning Liu wrote: >> The MEM form is more "canonical", so the loop SM machinery to detect >> equality should be adjusted accordingly.  Alternatively you can teach >> PRE insertion to strip off the MEM if possible (though >> fold_stmt_inplace should >> arelady do

RE: A problem about loop store motion

2012-02-21 Thread Jiangning Liu
> The MEM form is more "canonical", so the loop SM machinery to detect > equality should be adjusted accordingly. Alternatively you can teach > PRE insertion to strip off the MEM if possible (though > fold_stmt_inplace should > arelady do this if possible). Richard, Thank you! You are right. I n

Re: A problem about loop store motion

2012-02-20 Thread Richard Guenther
On Mon, Feb 20, 2012 at 9:46 AM, Jiangning Liu wrote: > > >> -Original Message- >> From: gcc-ow...@gcc.gnu.org [mailto:gcc-ow...@gcc.gnu.org] On Behalf Of >> Jiangning Liu >> Sent: Friday, February 17, 2012 5:53 PM >> To: gcc@gcc.gnu.org >>

RE: A problem about loop store motion

2012-02-20 Thread Jiangning Liu
> -Original Message- > From: gcc-ow...@gcc.gnu.org [mailto:gcc-ow...@gcc.gnu.org] On Behalf Of > Jiangning Liu > Sent: Friday, February 17, 2012 5:53 PM > To: gcc@gcc.gnu.org > Subject: A problem about loop store motion > > Hi, > > For this small tes

A problem about loop store motion

2012-02-17 Thread Jiangning Liu
Hi, For this small test case, int *l, *r; int test_func(void) { int i; int direction; static int pos; pos = 0; direction = 1; for ( i = 0; i <= 400; i++ ) { if ( direction == 0 ) pos = l[pos];