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 RFA: Change MIPS ffs<mode>2 from define_insn to define_expand


Ian Lance Taylor <ian@airs.com> writes:
> Richard Sandiford <richard@codesourcery.com> writes:
>> Yeah, for what it's worth, I largely agree.  If it had been up to me,
>> I'd have been very open to your first idea of dropping the patterns
>> altogether.
>> 
>> If we do expand inline, I think it ought to be done according to some
>> sort of cost model.  The current patterns are trivially broken for -Os
>> on mips*-elf because the call sequence would be shorter than the inline
>> loop.  The trade-offs for -O2 are more complex, and that's a good reason
>> why they shouldn't be duplicated (or ignored) by backends.  For example,
>> in the presence of profile-directed inlining, we might want to handle
>> "cold" and "hot" calls differently.
>> 
>> I'd consider it a bug that the ffs "optimisation" produces strictly
>> bigger code for -Os.  And given that there's nothing particularly
>> MIPS-specific in what the patterns are doing, I think that removing
>> them is a good fix.  Anyone who believes that an inline loop should
>> be used, and who's sufficiently motivated to do it where it belongs,
>> can do that as a follow-on patch.
>
> Well, I tested the appended patch on the MIPS simulator.  It works
> fine.
>
> If we remove the ffs insn pattern for any case, then I would argue
> strongly that we should remove it for all cases.

FWIW, like I said above, I personally agree that this is a good idea.
Eric: do you still want to keep the pattern, or is Ian's patch OK?

Richard


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