OSDN Git Service

* config/rs6000/rs6000.c (rs6000_register_move_cost): Increase cost
authorpthaugen <pthaugen@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 22 Apr 2008 19:28:56 +0000 (19:28 +0000)
committerpthaugen <pthaugen@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 22 Apr 2008 19:28:56 +0000 (19:28 +0000)
of LR/CTR moves for Power6.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@134565 138bc75d-0d04-0410-961f-82ee72b054a4

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

index 8127c33..761cf7f 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 024c140..6ac9ee1 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];