On 4/24/23 10:28 AM, Jakub Jelinek wrote:
> On Mon, Apr 24, 2023 at 10:23:06AM -0500, Peter Bergner wrote:
>> On 4/19/23 3:00 PM, Segher Boessenkool wrote:
>>> On Wed, Apr 19, 2023 at 11:23:07PM +0530, Ajit Agarwal wrote:
>>>>    * common/config/rs6000/rs6000-common.cc: Add REE pass as a
>>>>    default rs6000 target pass for O2 and above.
>>>
>>> Why only for -O2?  Only when optimising at all makes sense, people use
>>> -O0 only when they want to skip as many optimisations as possible, maybe
>>> because of compilation time concerns, maybe to avoid an ICE or other
>>> bug.  Isn't REE *always* a good thing, it never degrades code quality?
>>> Or are there situations where it results in worse code?
>>
>> I think this is a case of following what the other architectures are doing.
>> Namely, x86, aarch64, riscv, sparc, alpha and h8300 all enable -free at
>> -O2 and above, not -O1.  Not to say that is the best answer, but I think
>> that is why we did the same.  I agree I don't think -free can produce
>> worse code which makes using it with -O1 and above an option.  Maybe someone
>> was worried about compile time???  Doesn't seem like an optimization like
>> this would be too expensive though.
> 
> I thought that
>   df_chain_add_problem (DF_UD_CHAIN + DF_DU_CHAIN);
> is quite expensive (only other pass which does that is SMS pass) and
>   df_mir_add_problem ();
> as well (REE pass being the only user of that).  As -O1 is meant to scale
> well on huge compiler generated functions, perhaps REE isn't appropriate
> for those by default.

Ah, so it is an issue with compile time then.  If so, then sure, being -O2
and above makes sense then.  Thanks for pointing that out!

Peter


Reply via email to