Patchwork PATCH: PR rtl-optimization/44326: NONDEBUG_INSN_P should be used in implicit-zee.c

login
register
mail settings
Submitter H.J. Lu
Date June 25, 2010, 2:20 p.m.
Message ID <20100625142043.GA25783@intel.com>
Download mbox | patch
Permalink /patch/56913/
State New
Headers show

Comments

H.J. Lu - June 25, 2010, 2:20 p.m.
Hi,

When searching removable zero extends, there is no need to exam debug
insns.  Tested on Linux/x86-64.   OK to install?

Thanks.


H.J.
---
2010-06-25  H.J. Lu  <hongjiu.lu@intel.com>

	PR rtl-optimization/44326
	* implicit-zee.c (find_removable_zero_extends): Replace
	INSN_P with NONDEBUG_INSN_P.
Richard Guenther - June 25, 2010, 2:25 p.m.
On Fri, Jun 25, 2010 at 4:20 PM, H.J. Lu <hongjiu.lu@intel.com> wrote:
> Hi,
>
> When searching removable zero extends, there is no need to exam debug
> insns.  Tested on Linux/x86-64.   OK to install?

INSN_P already icnludes DEBUG_INSNs, so I don't see how this
patch makes sense.

> Thanks.
>
>
> H.J.
> ---
> 2010-06-25  H.J. Lu  <hongjiu.lu@intel.com>
>
>        PR rtl-optimization/44326
>        * implicit-zee.c (find_removable_zero_extends): Replace
>        INSN_P with NONDEBUG_INSN_P.
>
> diff --git a/gcc/implicit-zee.c b/gcc/implicit-zee.c
> index 3344d7f..46029cd 100644
> --- a/gcc/implicit-zee.c
> +++ b/gcc/implicit-zee.c
> @@ -858,7 +858,7 @@ find_removable_zero_extends (void)
>     {
>       FOR_BB_INSNS (curr_block, curr_insn)
>         {
> -          if (!INSN_P (curr_insn))
> +          if (!NONDEBUG_INSN_P (curr_insn))
>             continue;
>
>           type = for_each_rtx (&PATTERN (curr_insn),
>
H.J. Lu - June 25, 2010, 2:56 p.m.
On Fri, Jun 25, 2010 at 7:25 AM, Richard Guenther
<richard.guenther@gmail.com> wrote:
> On Fri, Jun 25, 2010 at 4:20 PM, H.J. Lu <hongjiu.lu@intel.com> wrote:
>> Hi,
>>
>> When searching removable zero extends, there is no need to exam debug
>> insns.  Tested on Linux/x86-64.   OK to install?
>
> INSN_P already icnludes DEBUG_INSNs, so I don't see how this
> patch makes sense.

if (!INSN_P (curr_insn)) won't match  DEBUG_INSNs and
we are examing  DEBUG_INSNs for nothing.


H.J.
---
>> Thanks.
>>
>>
>> H.J.
>> ---
>> 2010-06-25  H.J. Lu  <hongjiu.lu@intel.com>
>>
>>        PR rtl-optimization/44326
>>        * implicit-zee.c (find_removable_zero_extends): Replace
>>        INSN_P with NONDEBUG_INSN_P.
>>
>> diff --git a/gcc/implicit-zee.c b/gcc/implicit-zee.c
>> index 3344d7f..46029cd 100644
>> --- a/gcc/implicit-zee.c
>> +++ b/gcc/implicit-zee.c
>> @@ -858,7 +858,7 @@ find_removable_zero_extends (void)
>>     {
>>       FOR_BB_INSNS (curr_block, curr_insn)
>>         {
>> -          if (!INSN_P (curr_insn))
>> +          if (!NONDEBUG_INSN_P (curr_insn))
>>             continue;
>>
>>           type = for_each_rtx (&PATTERN (curr_insn),
>>
>
Richard Guenther - June 25, 2010, 2:58 p.m.
On Fri, Jun 25, 2010 at 4:56 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
> On Fri, Jun 25, 2010 at 7:25 AM, Richard Guenther
> <richard.guenther@gmail.com> wrote:
>> On Fri, Jun 25, 2010 at 4:20 PM, H.J. Lu <hongjiu.lu@intel.com> wrote:
>>> Hi,
>>>
>>> When searching removable zero extends, there is no need to exam debug
>>> insns.  Tested on Linux/x86-64.   OK to install?
>>
>> INSN_P already icnludes DEBUG_INSNs, so I don't see how this
>> patch makes sense.
>
> if (!INSN_P (curr_insn)) won't match  DEBUG_INSNs and
> we are examing  DEBUG_INSNs for nothing.

I see I was confused.

Pathc is ok.

Richard.
>
> H.J.
> ---
>>> Thanks.
>>>
>>>
>>> H.J.
>>> ---
>>> 2010-06-25  H.J. Lu  <hongjiu.lu@intel.com>
>>>
>>>        PR rtl-optimization/44326
>>>        * implicit-zee.c (find_removable_zero_extends): Replace
>>>        INSN_P with NONDEBUG_INSN_P.
>>>
>>> diff --git a/gcc/implicit-zee.c b/gcc/implicit-zee.c
>>> index 3344d7f..46029cd 100644
>>> --- a/gcc/implicit-zee.c
>>> +++ b/gcc/implicit-zee.c
>>> @@ -858,7 +858,7 @@ find_removable_zero_extends (void)
>>>     {
>>>       FOR_BB_INSNS (curr_block, curr_insn)
>>>         {
>>> -          if (!INSN_P (curr_insn))
>>> +          if (!NONDEBUG_INSN_P (curr_insn))
>>>             continue;
>>>
>>>           type = for_each_rtx (&PATTERN (curr_insn),
>>>
>>
>
>
>
> --
> H.J.
>
Jakub Jelinek - June 25, 2010, 3:27 p.m.
On Fri, Jun 25, 2010 at 04:58:02PM +0200, Richard Guenther wrote:
> On Fri, Jun 25, 2010 at 4:56 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
> > On Fri, Jun 25, 2010 at 7:25 AM, Richard Guenther
> > <richard.guenther@gmail.com> wrote:
> >> On Fri, Jun 25, 2010 at 4:20 PM, H.J. Lu <hongjiu.lu@intel.com> wrote:
> >>> Hi,
> >>>
> >>> When searching removable zero extends, there is no need to exam debug
> >>> insns.  Tested on Linux/x86-64.   OK to install?
> >>
> >> INSN_P already icnludes DEBUG_INSNs, so I don't see how this
> >> patch makes sense.
> >
> > if (!INSN_P (curr_insn)) won't match  DEBUG_INSNs and
> > we are examing  DEBUG_INSNs for nothing.
> 
> I see I was confused.
> 
> Pathc is ok.

BTW, I wonder if for_each_rtx is the right thing to find sets, wouldn't
note_stores be much better function for that?

	Jakub
Eric Botcazou - June 26, 2010, 7:54 a.m.
> BTW, I wonder if for_each_rtx is the right thing to find sets, wouldn't
> note_stores be much better function for that?

Right, note_stores/note_uses is the correct way to find sets/uses.  A patch to 
fix this is pre-approved.

Patch

diff --git a/gcc/implicit-zee.c b/gcc/implicit-zee.c
index 3344d7f..46029cd 100644
--- a/gcc/implicit-zee.c
+++ b/gcc/implicit-zee.c
@@ -858,7 +858,7 @@  find_removable_zero_extends (void)
     {
       FOR_BB_INSNS (curr_block, curr_insn)
         {
-          if (!INSN_P (curr_insn))
+          if (!NONDEBUG_INSN_P (curr_insn))
             continue;
 
           type = for_each_rtx (&PATTERN (curr_insn),