RFA: patch solving one IRA problem reported in PR37243
Jeff Law
law@redhat.com
Sun Aug 31 18:36:00 GMT 2008
Vladimir Makarov wrote:
> The following patch solves IRA regression on pr36222 and p36246 of gcc
> testsuite. The analysis of the problem could be found in
>
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37243
>
> The patch has been bootstrapped sucessfully on x86_64. It also
> improves SPEC results at least for x86.
>
> 2008-08-29 Vladimir Makarov <vmakarov@redhat.com>
>
> PR rtl-opt/37243
>
> * ira-conflicts.c (REG_SUBREG_P, go_through_subreg): New.
> (process_regs_for_copy): Process subregs. Refine check when cost
> is taken into account in ira-costs.c.
> (process_reg_shuffles): Use REG_SUBREG_P.
> (add_insn_allocno_copies): Ditto. Ignore modes.
>
> * ira-color.c (conflict_allocno_vec): New.
> (COST_HOP_DIVISOR): New macro.
> (update_copy_costs_1): Use it.
> (update_conflict_hard_regno_costs): New function.
> (assign_hard_reg): Use it.
> (ira_color): Allocate and free conflict_allocno_vec.
>
This got me thinking about a long standing poor code problem on the H8
(and likely other processors). Can IRA "tie" a dying source operand to
a destination operand when the source & destination operands have
different modes?
This comes up with the zero/sign extension patterns on some targets.
The source & destination are required to match, but they have different
modes. This case was never handled well by the old allocator resulting
in some obviously bad register allocations.
Jeff
More information about the Gcc-patches
mailing list