From: Chung-Ju Wu Date: Sat, 17 Mar 2018 11:51:46 +0000 (+0000) Subject: [NDS32] Optimize nds32_register_priority. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6a5a7ee306195abf513fbbb0c4aff717ce3359dc;p=gcc.git [NDS32] Optimize nds32_register_priority. gcc/ * config/nds32/nds32.c (nds32_register_priority): Modify cost. From-SVN: r258619 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 1063fd82f83..0ff36d1ba2c 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +2018-03-17 Chung-Ju Wu + + * config/nds32/nds32.c (nds32_register_priority): Modify cost. + 2018-03-17 Jakub Jelinek PR target/84902 diff --git a/gcc/config/nds32/nds32.c b/gcc/config/nds32/nds32.c index 80b00f147dd..02b1eb40a9e 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; + } }