From aafc759a8a4e404469bf39a92bb10522baf4a281 Mon Sep 17 00:00:00 2001 From: Pat Haugen Date: Tue, 22 Apr 2008 19:28:56 +0000 Subject: [PATCH] rs6000.c (rs6000_register_move_cost): Increase cost of LR/CTR moves for Power6. * config/rs6000/rs6000.c (rs6000_register_move_cost): Increase cost of LR/CTR moves for Power6. From-SVN: r134565 --- gcc/ChangeLog | 5 +++++ gcc/config/rs6000/rs6000.c | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 8127c33dbe4..761cf7ff994 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2008-04-22 Pat Haugen + + * config/rs6000/rs6000.c (rs6000_register_move_cost): Increase cost + of LR/CTR moves for Power6. + 2008-04-22 Kenneth Zadeck PR middle-end/36003 diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index 024c140b274..6ac9ee159f9 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -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]; -- 2.30.2