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: Performance regression


Richard Earnshaw wrote:
> I found that I got significantly better code on the ARM when I rewrote the
> movqi expander to for load-byte(mem) to use
>
>           if (GET_CODE (operands[1]) == MEM && optimize > 0)
>             {
>               rtx reg = gen_reg_rtx (SImode);
>
>               emit_insn (gen_zero_extendqisi2 (reg, operands[1]));
>               operands[1] = gen_lowpart (QImode, reg);
>             }
>
> Of course, you can only do this during initial expansion (when you can
> create new pseudos).  The change meant that we never use implicit
> zero-extension operations so the compiler was able to remove several
> zero-/sign-extend operations which were clearly redundant.

I like this solution.  I wasn't sure whether this would work or might
interact strangely with other parts of the compiler, but the ARM
back-end is "proof by implementation".

Roger
--


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