[RS6000] out-of-line exit register restore funcs

* config/rs6000/rs6000.c (rs6000_savres_strategy): Don't use
	out-of-line gpr restore for one or two regs if that would add
	a save of lr.

From-SVN: r235907
This commit is contained in:
Alan Modra 2016-05-05 07:02:27 +09:30 committed by Alan Modra
parent fdab73dc76
commit 662fa3ba61
2 changed files with 21 additions and 9 deletions

View File

@ -1,3 +1,9 @@
2016-05-05 Alan Modra <amodra@gmail.com>
* config/rs6000/rs6000.c (rs6000_savres_strategy): Don't use
out-of-line gpr restore for one or two regs if that would add
a save of lr.
2016-05-04 Uros Bizjak <ubizjak@gmail.com>
PR target/70873

View File

@ -23422,6 +23422,15 @@ rs6000_savres_strategy (rs6000_stack_t *info,
}
}
/* info->lr_save_p isn't yet set if the only reason lr needs to be
saved is an out-of-line save or restore. Set up the value for
the next test (excluding out-of-line gprs). */
bool lr_save_p = (info->lr_save_p
|| !(strategy & SAVE_INLINE_FPRS)
|| !(strategy & SAVE_INLINE_VRS)
|| !(strategy & REST_INLINE_FPRS)
|| !(strategy & REST_INLINE_VRS));
if (TARGET_MULTIPLE
&& !TARGET_POWERPC64
&& !(TARGET_SPE_ABI && info->spe_64bit_regs_used)
@ -23431,15 +23440,6 @@ rs6000_savres_strategy (rs6000_stack_t *info,
since the store-multiple instruction will always be smaller. */
strategy |= SAVE_INLINE_GPRS | SAVE_MULTIPLE;
/* info->lr_save_p isn't yet set if the only reason lr needs to be
saved is an out-of-line save or restore. Set up the value for
the next test (excluding out-of-line gprs). */
bool lr_save_p = (info->lr_save_p
|| !(strategy & SAVE_INLINE_FPRS)
|| !(strategy & SAVE_INLINE_VRS)
|| !(strategy & REST_INLINE_FPRS)
|| !(strategy & REST_INLINE_VRS));
/* The situation is more complicated with load multiple. We'd
prefer to use the out-of-line routines for restores, since the
"exit" out-of-line routines can handle the restore of LR and the
@ -23452,6 +23452,12 @@ rs6000_savres_strategy (rs6000_stack_t *info,
strategy |= REST_INLINE_GPRS | REST_MULTIPLE;
}
/* Using the "exit" out-of-line routine does not improve code size
if using it would require lr to be saved and if only saving one
or two gprs. */
else if (!lr_save_p && info->first_gp_reg_save > 29)
strategy |= SAVE_INLINE_GPRS | REST_INLINE_GPRS;
/* We can only use load multiple or the out-of-line routines to
restore gprs if we've saved all the registers from
first_gp_reg_save. Otherwise, we risk loading garbage.