Commit 2e7f5dc0 by H.J. Lu Committed by H.J. Lu

Change ix86_save_reg/ix86_hard_regno_mode_ok to return bool.

2011-05-13  H.J. Lu  <hongjiu.lu@intel.com>

	* config/i386/i386.c (ix86_save_reg): Change return type to
	bool.
	(ix86_hard_regno_mode_ok): Change return value to bool.  Use
	can_create_pseudo_p ().

From-SVN: r173731
parent e834e95c
2011-05-13 H.J. Lu <hongjiu.lu@intel.com>
* config/i386/i386.c (ix86_save_reg): Change return type to
bool.
(ix86_hard_regno_mode_ok): Change return value to bool. Use
can_create_pseudo_p ().
2011-05-13 Richard Guenther <rguenther@suse.de> 2011-05-13 Richard Guenther <rguenther@suse.de>
PR lto/48978 PR lto/48978
......
...@@ -9001,8 +9001,9 @@ ix86_select_alt_pic_regnum (void) ...@@ -9001,8 +9001,9 @@ ix86_select_alt_pic_regnum (void)
return INVALID_REGNUM; return INVALID_REGNUM;
} }
/* Return 1 if we need to save REGNO. */ /* Return TRUE if we need to save REGNO. */
static int
static bool
ix86_save_reg (unsigned int regno, bool maybe_eh_return) ix86_save_reg (unsigned int regno, bool maybe_eh_return)
{ {
if (pic_offset_table_rtx if (pic_offset_table_rtx
...@@ -9011,11 +9012,7 @@ ix86_save_reg (unsigned int regno, bool maybe_eh_return) ...@@ -9011,11 +9012,7 @@ ix86_save_reg (unsigned int regno, bool maybe_eh_return)
|| crtl->profile || crtl->profile
|| crtl->calls_eh_return || crtl->calls_eh_return
|| crtl->uses_const_pool)) || crtl->uses_const_pool))
{ return ix86_select_alt_pic_regnum () == INVALID_REGNUM;
if (ix86_select_alt_pic_regnum () != INVALID_REGNUM)
return 0;
return 1;
}
if (crtl->calls_eh_return && maybe_eh_return) if (crtl->calls_eh_return && maybe_eh_return)
{ {
...@@ -9026,12 +9023,12 @@ ix86_save_reg (unsigned int regno, bool maybe_eh_return) ...@@ -9026,12 +9023,12 @@ ix86_save_reg (unsigned int regno, bool maybe_eh_return)
if (test == INVALID_REGNUM) if (test == INVALID_REGNUM)
break; break;
if (test == regno) if (test == regno)
return 1; return true;
} }
} }
if (crtl->drap_reg && regno == REGNO (crtl->drap_reg)) if (crtl->drap_reg && regno == REGNO (crtl->drap_reg))
return 1; return true;
return (df_regs_ever_live_p (regno) return (df_regs_ever_live_p (regno)
&& !call_used_regs[regno] && !call_used_regs[regno]
...@@ -28936,7 +28933,8 @@ ix86_register_move_cost (enum machine_mode mode, reg_class_t class1_i, ...@@ -28936,7 +28933,8 @@ ix86_register_move_cost (enum machine_mode mode, reg_class_t class1_i,
return 2; return 2;
} }
/* Return 1 if hard register REGNO can hold a value of machine-mode MODE. */ /* Return TRUE if hard register REGNO can hold a value of machine-mode
MODE. */
bool bool
ix86_hard_regno_mode_ok (int regno, enum machine_mode mode) ix86_hard_regno_mode_ok (int regno, enum machine_mode mode)
...@@ -28947,7 +28945,7 @@ ix86_hard_regno_mode_ok (int regno, enum machine_mode mode) ...@@ -28947,7 +28945,7 @@ ix86_hard_regno_mode_ok (int regno, enum machine_mode mode)
if (GET_MODE_CLASS (mode) == MODE_CC if (GET_MODE_CLASS (mode) == MODE_CC
|| GET_MODE_CLASS (mode) == MODE_RANDOM || GET_MODE_CLASS (mode) == MODE_RANDOM
|| GET_MODE_CLASS (mode) == MODE_PARTIAL_INT) || GET_MODE_CLASS (mode) == MODE_PARTIAL_INT)
return 0; return false;
if (FP_REGNO_P (regno)) if (FP_REGNO_P (regno))
return VALID_FP_MODE_P (mode); return VALID_FP_MODE_P (mode);
if (SSE_REGNO_P (regno)) if (SSE_REGNO_P (regno))
...@@ -28977,26 +28975,26 @@ ix86_hard_regno_mode_ok (int regno, enum machine_mode mode) ...@@ -28977,26 +28975,26 @@ ix86_hard_regno_mode_ok (int regno, enum machine_mode mode)
/* Take care for QImode values - they can be in non-QI regs, /* Take care for QImode values - they can be in non-QI regs,
but then they do cause partial register stalls. */ but then they do cause partial register stalls. */
if (regno <= BX_REG || TARGET_64BIT) if (regno <= BX_REG || TARGET_64BIT)
return 1; return true;
if (!TARGET_PARTIAL_REG_STALL) if (!TARGET_PARTIAL_REG_STALL)
return 1; return true;
return reload_in_progress || reload_completed; return !can_create_pseudo_p ();
} }
/* We handle both integer and floats in the general purpose registers. */ /* We handle both integer and floats in the general purpose registers. */
else if (VALID_INT_MODE_P (mode)) else if (VALID_INT_MODE_P (mode))
return 1; return true;
else if (VALID_FP_MODE_P (mode)) else if (VALID_FP_MODE_P (mode))
return 1; return true;
else if (VALID_DFP_MODE_P (mode)) else if (VALID_DFP_MODE_P (mode))
return 1; return true;
/* Lots of MMX code casts 8 byte vector modes to DImode. If we then go /* Lots of MMX code casts 8 byte vector modes to DImode. If we then go
on to use that value in smaller contexts, this can easily force a on to use that value in smaller contexts, this can easily force a
pseudo to be allocated to GENERAL_REGS. Since this is no worse than pseudo to be allocated to GENERAL_REGS. Since this is no worse than
supporting DImode, allow it. */ supporting DImode, allow it. */
else if (VALID_MMX_REG_MODE_3DNOW (mode) || VALID_MMX_REG_MODE (mode)) else if (VALID_MMX_REG_MODE_3DNOW (mode) || VALID_MMX_REG_MODE (mode))
return 1; return true;
return 0; return false;
} }
/* A subroutine of ix86_modes_tieable_p. Return true if MODE is a /* A subroutine of ix86_modes_tieable_p. Return true if MODE is a
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