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: [PATCH] LRA: Fix caller-save store/restore instruction for large mode



On 2015-01-05 12:31 PM, Jeff Law wrote:
On 01/05/15 00:44, Kito Cheng wrote:
Hi Vladimir:
   This patch has a discusses with you in May 2014, this patch is about
the caller-save register store and restore instruction generation, the
current LRA implementation will miss caller-save store/restore
instruction if need one more instruction.

You said you will investigate for this on IRC, so I don't send the
patch last year, however ARM guys seem got this problem too, so I
think it's time to send this patch :)

ChangeLog

2015-01-05  Kito Cheng  <kito@0xlab.org>

         * lra-constraints.c (split_reg): Fix caller-save store/restore
instruction generation.
Please reference PR64348 in the ChangeLog entry.

Please include a testcase if there isn't one in the regression suite already.

Please indicate what platform this patch was bootstrapped and regression tested on.

The dumping code immediately after the assert you removed has code like this in both cases:



         fprintf (lra_dump_file,
                   "    Rejecting split %d->%d "
                   "resulting in > 2 %s restore insns:\n",
original_regno, REGNO (new_reg), call_save_p ? "call" : "");

Testing call_save_p here won't make any sense after your patch.

I'll let Vlad chime in on the correctness of allowing multi register saves/restores in this code.

The solution itself is ok. Prohibiting generation of more one insn was intended for inheritance only as inheritance transformation can be undone when the inheritance pseudo does not get a hard register. Undoing multi-register splitting is difficult and also such splitting is doubtedly profitable.

Splitting for save/restore is never undone. So it is ok for this case to generate multi-register saves/restores.

Kito, Jeff wrote reasonable changes for the patch. Please, do them and you can commit the patch.

Thanks.


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