rs6000.c (rs6000_register_move_cost): Increase cost of LR/CTR moves for Power6.
authorPat Haugen <pthaugen@us.ibm.com>
Tue, 22 Apr 2008 19:28:56 +0000 (19:28 +0000)
committerPat Haugen <pthaugen@gcc.gnu.org>
Tue, 22 Apr 2008 19:28:56 +0000 (19:28 +0000)
* config/rs6000/rs6000.c (rs6000_register_move_cost): Increase cost
of LR/CTR moves for Power6.

From-SVN: r134565

gcc/ChangeLog
gcc/config/rs6000/rs6000.c

index 8127c33dbe4c5d3c71e1d83d2f8c81a20869a580..761cf7ff99485bb5286741dab63dc250c602ecdb 100644 (file)
@@ -1,3 +1,8 @@
+2008-04-22  Pat Haugen  <pthaugen@us.ibm.com>
+
+       * config/rs6000/rs6000.c (rs6000_register_move_cost): Increase cost
+       of LR/CTR moves for Power6.
+
 2008-04-22  Kenneth Zadeck <zadeck@naturalbridge.com>
 
        PR middle-end/36003
index 024c140b27454b462e16ecb550eb4cb33979736a..6ac9ee159f9741a5f1d0e794ffa108ef108c8798 100644 (file)
@@ -21331,6 +21331,12 @@ rs6000_register_move_cost (enum machine_mode mode,
       else if (from == CR_REGS)
        return 4;
 
+      /* Power6 has slower LR/CTR moves so make them more expensive than
+        memory in order to bias spills to memory .*/
+      else if (rs6000_cpu == PROCESSOR_POWER6
+              && reg_classes_intersect_p (from, LINK_OR_CTR_REGS))
+        return 6 * hard_regno_nregs[0][mode];
+
       else
        /* A move will cost one instruction per GPR moved.  */
        return 2 * hard_regno_nregs[0][mode];