> Andrew Pinski <[EMAIL PROTECTED]> writes: >> Björn Haase <[EMAIL PROTECTED]> 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.