Commit 6a5a7ee3 by Chung-Ju Wu Committed by Chung-Ju Wu

[NDS32] Optimize nds32_register_priority.

gcc/
	* config/nds32/nds32.c (nds32_register_priority): Modify cost.

From-SVN: r258619
parent 677956e8
2018-03-17 Chung-Ju Wu <jasonwucj@gmail.com>
* config/nds32/nds32.c (nds32_register_priority): Modify cost.
2018-03-17 Jakub Jelinek <jakub@redhat.com>
PR target/84902
......
......@@ -1234,9 +1234,24 @@ static int
nds32_register_priority (int hard_regno)
{
/* Encourage to use r0-r7 for LRA when optimize for size. */
if (optimize_size && hard_regno < 8)
return 4;
return 3;
if (optimize_size)
{
if (hard_regno < 8)
return 4;
else if (hard_regno < 16)
return 3;
else if (hard_regno < 28)
return 2;
else
return 1;
}
else
{
if (hard_regno > 27)
return 1;
else
return 4;
}
}
......
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