From 6829815d96cdc4fc0eedb1944977509033ed9db3 Mon Sep 17 00:00:00 2001 From: Hal Finkel Date: Sat, 10 Jan 2015 00:31:10 +0000 Subject: [PATCH] [PowerPC] Readjust the loop unrolling threshold Now that the way that the partial unrolling threshold for small loops is used to compute the unrolling factor as been corrected, a slightly smaller threshold is preferable. This is expected; other targets may need to re-tune as well. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225566 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/PowerPC/PPCScheduleP7.td | 4 +- lib/Target/PowerPC/PPCScheduleP8.td | 4 +- .../LoopUnroll/PowerPC/p7-unrolling.ll | 52 ++++++++++++++++++- 3 files changed, 54 insertions(+), 6 deletions(-) diff --git a/lib/Target/PowerPC/PPCScheduleP7.td b/lib/Target/PowerPC/PPCScheduleP7.td index 00aa834ca4b..03693cbeada 100644 --- a/lib/Target/PowerPC/PPCScheduleP7.td +++ b/lib/Target/PowerPC/PPCScheduleP7.td @@ -380,8 +380,8 @@ def P7Model : SchedMachineModel { // Itineraries are queried instead. let MispredictPenalty = 16; - // Try to make sure we have at least 10-11 dispatch groups in a loop. - let LoopMicroOpBufferSize = 44; + // Try to make sure we have at least 10 dispatch groups in a loop. + let LoopMicroOpBufferSize = 40; let Itineraries = P7Itineraries; } diff --git a/lib/Target/PowerPC/PPCScheduleP8.td b/lib/Target/PowerPC/PPCScheduleP8.td index 8cdc79e9d14..07971809c87 100644 --- a/lib/Target/PowerPC/PPCScheduleP8.td +++ b/lib/Target/PowerPC/PPCScheduleP8.td @@ -389,8 +389,8 @@ def P8Model : SchedMachineModel { // Itineraries are queried instead. let MispredictPenalty = 16; - // Try to make sure we have at least 10-11 dispatch groups in a loop. - let LoopMicroOpBufferSize = 66; + // Try to make sure we have at least 10 dispatch groups in a loop. + let LoopMicroOpBufferSize = 60; let Itineraries = P8Itineraries; } diff --git a/test/Transforms/LoopUnroll/PowerPC/p7-unrolling.ll b/test/Transforms/LoopUnroll/PowerPC/p7-unrolling.ll index b2ea74a75da..7a50fc0a4f4 100644 --- a/test/Transforms/LoopUnroll/PowerPC/p7-unrolling.ll +++ b/test/Transforms/LoopUnroll/PowerPC/p7-unrolling.ll @@ -22,7 +22,31 @@ exit: ; CHECK-NEXT: add ; CHECK-NEXT: add ; CHECK-NEXT: add -; CHECK: icmp +; CHECK-NEXT: add +; CHECK-NEXT: add +; CHECK-NEXT: add +; CHECK-NEXT: add +; CHECK-NEXT: add +; CHECK-NEXT: add +; CHECK-NEXT: add +; CHECK-NEXT: add +; CHECK-NEXT: add +; CHECK-NEXT: add +; CHECK-NEXT: add +; CHECK-NEXT: add +; CHECK-NEXT: add +; CHECK-NEXT: add +; CHECK-NEXT: add +; CHECK-NEXT: add +; CHECK-NEXT: add +; CHECK-NEXT: add +; CHECK-NEXT: add +; CHECK-NEXT: add +; CHECK-NEXT: add +; CHECK-NEXT: add +; CHECK-NEXT: add +; CHECK-NEXT: add +; CHECK-NEXT: icmp define void @unroll_default() nounwind { entry: @@ -47,5 +71,29 @@ exit: ; CHECK-NEXT: add ; CHECK-NEXT: add ; CHECK-NEXT: add -; CHECK: icmp +; CHECK-NEXT: add +; CHECK-NEXT: add +; CHECK-NEXT: add +; CHECK-NEXT: add +; CHECK-NEXT: add +; CHECK-NEXT: add +; CHECK-NEXT: add +; CHECK-NEXT: add +; CHECK-NEXT: add +; CHECK-NEXT: add +; CHECK-NEXT: add +; CHECK-NEXT: add +; CHECK-NEXT: add +; CHECK-NEXT: add +; CHECK-NEXT: add +; CHECK-NEXT: add +; CHECK-NEXT: add +; CHECK-NEXT: add +; CHECK-NEXT: add +; CHECK-NEXT: add +; CHECK-NEXT: add +; CHECK-NEXT: add +; CHECK-NEXT: add +; CHECK-NEXT: add +; CHECK-NEXT: icmp