diff options
author | Chung-Ju Wu <jasonwucj@gmail.com> | 2018-03-17 11:51:46 +0000 |
---|---|---|
committer | Chung-Ju Wu <jasonwucj@gcc.gnu.org> | 2018-03-17 11:51:46 +0000 |
commit | 6a5a7ee306195abf513fbbb0c4aff717ce3359dc (patch) | |
tree | 9b45f5e211262c42102e03adc787830a57eebf39 /gcc/config | |
parent | 677956e82fc1b349da319c13053b894ec233deb0 (diff) | |
download | gcc-6a5a7ee306195abf513fbbb0c4aff717ce3359dc.zip gcc-6a5a7ee306195abf513fbbb0c4aff717ce3359dc.tar.gz gcc-6a5a7ee306195abf513fbbb0c4aff717ce3359dc.tar.bz2 |
[NDS32] Optimize nds32_register_priority.
gcc/
* config/nds32/nds32.c (nds32_register_priority): Modify cost.
From-SVN: r258619
Diffstat (limited to 'gcc/config')
-rw-r--r-- | gcc/config/nds32/nds32.c | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/gcc/config/nds32/nds32.c b/gcc/config/nds32/nds32.c index 80b00f1..02b1eb4 100644 --- a/gcc/config/nds32/nds32.c +++ b/gcc/config/nds32/nds32.c @@ -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; + } } |