This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Missed optimizations: Constant propagation / algebraicsimplification re-run after after reload.?
- From: Paul Schlie <schlie at comcast dot net>
- To: Andrew Pinski <pinskia at physics dot uc dot edu>,Björn Haase <bjoern dot m dot haase at web dot de>,<gcc at gcc dot gnu dot org>
- Date: Fri, 06 May 2005 17:44:47 -0400
- Subject: Re: Missed optimizations: Constant propagation / algebraicsimplification re-run after after reload.?
> Andrew Pinski <pinskia@physics.uc.edu> writes:
>> Björn Haase <bjoern.m.haase@web.de> writes:
>> when working on the AVR target I stepped over the follwoing issue
>> (IMO not urgent but still bearing quite some potential of improvement):
>>
>> When implementing "lowering" of SImode and HImode expressions to QImode
>> sequences by splitters after reload, quite a number of new optimization
>> opportunities show up that presently are not realized. These would probably
>> require that some kind of constant propagation and algebraic simplification
>> would be re-run *after* reload.
>> A typical case are mixed-mode expressions like in the function
>>
>> uint16_t
>> dummy (uint8_t y, uint32_t x)
>> {
>> return x & y;
>> }
>
> You should expand this at expand time instead as there are enough
> optimizations before expand time to get to it optimized.
It would seem most ideal if GCC first lowered all operations to their
canonical minimal precision form prior to code generation, yielding:
(set (reg:hi ret) (zero_extend:hi (and:qi (reg:qi y) (subreg:qi x 0))))
Where then it may be expanded as most appropriate for an arbitrary target.