LEA-splitting improvement patch.

Uros Bizjak ubizjak@gmail.com
Tue Aug 14 12:37:00 GMT 2012


On Tue, Aug 14, 2012 at 2:28 PM, Yuri Rumyantsev <ysrumyan@gmail.com> wrote:

> Thanks  a lot forr your comments.
>
> I prepared new patch and ChangeLog. Testing of x32 is in progress.
>
> It it OK for trunk?
>
> 2012-08-14  Yuri Rumyantsev  <ysrumyan@gmail.com>
>
>         * config/i386/i386-protos.h (ix86_split_lea_for_addr) : Add
>         additional argument.
>         * config/i386/i386.md (ix86_split_lea_for_addr) : Add
>         additional argument curr_insn.
>         * config/i386/i386.c (ix86_split_lea_for_addr): Do instructions
>         reodering to get opportunities for better scheduling.
>         (ix86_lea_outperforms): Do more aggressive lea splitting.

You are not doing splitting in ix86_lea_outperforms.

>         (find_nearest_reg-def): New function. Find nearest register
>         definition used in address.

Just say:

(find_nearest_reg_def): New function.

+	      emit_insn (gen_rtx_SET (VOIDmode, target, tmp));
+              if (parts.disp && parts.disp != const0_rtx)
+                ix86_emit_binop (PLUS, mode, target, parts.disp);
+              ix86_emit_binop (PLUS, mode, target, tmp1);
+	      return;

Can you explain, why you have to duplicate this code? Here you
generate the same sequence as in the code below. Use tmp and tmp1 in
the way that it will fit existing code.

Uros.



More information about the Gcc-patches mailing list