[PATCH, PR 32824] Add an additional LIM pass to assist dead code elimination
Fang, Changpeng
Changpeng.Fang@amd.com
Wed Mar 17 22:57:00 GMT 2010
Attached is the updated patch (with testcase). And below is the changelog entry.
2010-03-16 Changpeng Fang <changpeng.fang@amd.com>
PR middle-end/32824
* passes.c (init_optimization_passes): move pass_lim before
pass_copy_prop,pass_dce_loop in the loop optimizer.
* gcc.dg/vect/pr32824: New.
Thanks,
Changpeng
________________________________________
From: Richard Guenther [richard.guenther@gmail.com]
Sent: Wednesday, March 17, 2010 12:39 PM
To: Fang, Changpeng
Cc: gcc-patches@gcc.gnu.org; rakdver@gcc.gnu.org; spop@gcc.gnu.org
Subject: Re: [PATCH, PR 32824] Add an additional LIM pass to assist dead code elimination
On Wed, Mar 17, 2010 at 6:03 PM, Fang, Changpeng <Changpeng.Fang@amd.com> wrote:
> Hi,
> I have updated the patch to move the existing LIM pass before copyprop/dce in the loop optimizer.
> This patch helps eliminate dead code and make the reduction statement vectorizable when the reduction
> variable is global. The patch fixes PR 32824.
>
> Note that the problem reported in PR32824 is very popular in fortran code. I am working on Levine benchmark
> and found that there are at least 9 such cases.
>
> This patch passed bootstrapping and regression tests. I also tested on spec cpu2006 and found there is no
> performance impact.
>
> Is it OK for the trunk?
It is ok once stage1 opens.
Thanks,
Richard.
> Thanks,
>
> Changpeng
>
>
> ________________________________________
> From: Richard Guenther [richard.guenther@gmail.com]
> Sent: Tuesday, March 16, 2010 5:24 AM
> To: Fang, Changpeng
> Cc: gcc-patches@gcc.gnu.org; rakdver@gcc.gnu.org; spop@gcc.gnu.org
> Subject: Re: [PATCH, PR 32824] Add an additional LIM pass to assist dead code elimination
>
> On Mon, Mar 15, 2010 at 10:14 PM, Fang, Changpeng
> <Changpeng.Fang@amd.com> wrote:
>> This patch fixes bug 32824: Missed reduction vectorizer after store to global is LIM'd
>>
>> Patch Description:
>> After store to global is LIM'ed, we need a copy propagation and dead code elimination to eliminate
>> the dead store in the loop, and thus make the reduction vectorizable. In this patch, I added an additional LIM
>> pass at the very beginning of the loop optimizer, then the dead code can be eliminated by pass_dce_loop
>> before the vectorizer.
>>
>> With this patch, the related fortran code (refer to bug 32824 report) can also be vectorized.
>>
>> I have bootstrapped gcc with the patch and compiled and spec cpu2006 and found no apparent regression
>> in both compilation time and spec scores.
>
> I'm not too keen on adding another expensive pass like LIM. Did you
> try simply moving the existing LIM pass before copyprop/dce?
>
> Thanks,
> Richard.
>
>> Thanks,
>>
>> Changpeng
>>
>>
>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-pr32824.patch
Type: text/x-patch
Size: 1749 bytes
Desc: 0001-pr32824.patch
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20100317/4e5a3683/attachment.bin>
More information about the Gcc-patches
mailing list