Commit 9ecf84e6 by Kwok Cheung Yeung Committed by Kwok Cheung Yeung

[amdgcn] Fix handling of VCC_CONDITIONAL_REG

Classify vcc_lo and vcc_hi into the VCC_CONDITIONAL_REG class,
and spill them into SGPRs if necessary.

2019-11-15  Kwok Cheung Yeung  <kcy@codesourcery.com>

	gcc/
	* config/gcn/gcn.c (gcn_regno_reg_class): Return VCC_CONDITIONAL_REG
	register class for VCC_LO and VCC_HI.
	(gcn_spill_class): Use SGPR_REGS to spill registers in
	VCC_CONDITIONAL_REG.

From-SVN: r278290
parent d03431d0
2019-11-15 Kwok Cheung Yeung <kcy@codesourcery.com>
* config/gcn/gcn.c (gcn_regno_reg_class): Return VCC_CONDITIONAL_REG
register class for VCC_LO and VCC_HI.
(gcn_spill_class): Use SGPR_REGS to spill registers in
VCC_CONDITIONAL_REG.
2019-11-15 Richard Biener <rguenther@suse.de> 2019-11-15 Richard Biener <rguenther@suse.de>
PR tree-optimization/92324 PR tree-optimization/92324
...@@ -462,6 +462,9 @@ gcn_regno_reg_class (int regno) ...@@ -462,6 +462,9 @@ gcn_regno_reg_class (int regno)
{ {
case SCC_REG: case SCC_REG:
return SCC_CONDITIONAL_REG; return SCC_CONDITIONAL_REG;
case VCC_LO_REG:
case VCC_HI_REG:
return VCC_CONDITIONAL_REG;
case VCCZ_REG: case VCCZ_REG:
return VCCZ_CONDITIONAL_REG; return VCCZ_CONDITIONAL_REG;
case EXECZ_REG: case EXECZ_REG:
...@@ -629,7 +632,8 @@ gcn_can_split_p (machine_mode, rtx op) ...@@ -629,7 +632,8 @@ gcn_can_split_p (machine_mode, rtx op)
static reg_class_t static reg_class_t
gcn_spill_class (reg_class_t c, machine_mode /*mode */ ) gcn_spill_class (reg_class_t c, machine_mode /*mode */ )
{ {
if (reg_classes_intersect_p (ALL_CONDITIONAL_REGS, c)) if (reg_classes_intersect_p (ALL_CONDITIONAL_REGS, c)
|| c == VCC_CONDITIONAL_REG)
return SGPR_REGS; return SGPR_REGS;
else else
return NO_REGS; return NO_REGS;
......
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