This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 3/3] Avoid emitting useless instructions in mips_process_sync_loop.


On 14/06/2012, at 6:59 AM, Richard Sandiford wrote:

> Maxim Kuvyrkov <maxim@codesourcery.com> writes:
>> +  /* Don't bother setting returns that are never used.  */
>> +  if (cmp && find_reg_note (insn, REG_UNUSED, cmp))
>> +    cmp = 0;
>> +  if (required_oldval && find_reg_note (insn, REG_UNUSED, required_oldval))
>> +    required_oldval = 0;
> 
> required_oldval is an important input (not output).  We can't drop it.
> I suppose we could replace oldval with AT if the non-AT register isn't used,
> but I'm not sure it's worth it.
> 
> The CMP part is OK though.

Thanks for pointing this out.  The optimization was motivated by the CMP part, as this is what's needed to generate same assembly as GLIBC has.

--
Maxim Kuvyrkov
CodeSourcery / Mentor Graphics



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]