Commit f95361c8 by Jeff Law

Major rework to have caller-saves emit load/store double insns when...

	Major rework to have caller-saves emit load/store double insns when
	possible and to avoid useless resaving of registers restored for
	source accesses only.
	* caller-save.c (toplevel): All arrays are multi-dimensional to
	hold information for multiple save/restore insns.  New variable
	hard_regs_need_restore.
	(choose_hard_reg_mode): New argument `nregs' indicating how many
	hard registers are desired.  All callers changed.
	(init_caller_save): Change initialization to handle multiple
	register saves.  A call-used register can not be live across
	if we can not find a single register mode to save it in.
	(multiple register saves are optional)
	(init_save_areas): Change initialization of regno_save_mem to
	handle multiple register saves.
	(setup_save_areas): Allocate space for consecutive hard registers
	in aligned consecutive memory locations.   When allocating space
	for consecutive hard registers, also initialize regno_save_mem
	for each hard register stored as a single word.
	(save_call_clobbered_regs): Initialize hard_regs_need_restore.
	Set hard_regs_need_restore to hard_regs_saved after crossing
	a call.  Also recompute n_regs_saved.  At the end of a basic block
	we need only restore registers in hard_regs_need_restore.
	(set_reg_live, clear_reg_live): Do the right thing for
	hard_regs_need_restore and hard_regs_saved.
	(restore_referenced_regs): Just return if X is a clobber.
	Test hard_regs_need_restore to determine when to restore a hard
	register from the save area.
	(insert_save_restore): Now returns the number of extra registers
	saved/restored.  New argument `maxrestore' which constrains how
	many hard registers should be restored.  All callers changed.
	Do stores of consecutive registers with double store insns if
	possible.  Else do them with single word insns. Likewise for
	loads, except constrained by maxrestore.  Set hard_regs_saved
	and hard_regs_need_restore appropriately to minimize useless
	saves into the save area.  Test against	hard_regs_need_restore
	when trying to restore multiple regs and similarly test against
	hard_regs_saved when storing multiple regs.

From-SVN: r1964
parent 52d2830e
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment