From f73400a864953bdb6a69cff0ea8b2e6350de07a1 Mon Sep 17 00:00:00 2001 From: Kevin Qin Date: Thu, 9 Oct 2014 10:13:27 +0000 Subject: [PATCH] [AArch64] Enable partial & runtime unrolling on cortex-a57. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219401 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/AArch64/AArch64SchedA57.td | 4 ++++ lib/Target/AArch64/AArch64TargetTransformInfo.cpp | 10 ++++++++++ 2 files changed, 14 insertions(+) diff --git a/lib/Target/AArch64/AArch64SchedA57.td b/lib/Target/AArch64/AArch64SchedA57.td index 4066db084d1..3ec41578a94 100644 --- a/lib/Target/AArch64/AArch64SchedA57.td +++ b/lib/Target/AArch64/AArch64SchedA57.td @@ -26,6 +26,10 @@ def CortexA57Model : SchedMachineModel { let MicroOpBufferSize = 128; // 128 micro-op re-order buffer let LoadLatency = 4; // Optimistic load latency let MispredictPenalty = 14; // Fetch + Decode/Rename/Dispatch + Branch + + // Enable partial & runtime unrolling. The magic number is chosen based on + // experiments and benchmarking data. + let LoopMicroOpBufferSize = 16; } //===----------------------------------------------------------------------===// diff --git a/lib/Target/AArch64/AArch64TargetTransformInfo.cpp b/lib/Target/AArch64/AArch64TargetTransformInfo.cpp index dbdf199a25c..b1a2914236b 100644 --- a/lib/Target/AArch64/AArch64TargetTransformInfo.cpp +++ b/lib/Target/AArch64/AArch64TargetTransformInfo.cpp @@ -128,6 +128,10 @@ public: unsigned getCostOfKeepingLiveOverCall(ArrayRef Tys) const override; + void getUnrollingPreferences(const Function *F, Loop *L, + UnrollingPreferences &UP) const override; + + /// @} }; @@ -544,3 +548,9 @@ unsigned AArch64TTI::getMaxInterleaveFactor() const { return 4; return 2; } + +void AArch64TTI::getUnrollingPreferences(const Function *F, Loop *L, + UnrollingPreferences &UP) const { + // Disable partial & runtime unrolling on -Os. + UP.PartialOptSizeThreshold = 0; +} -- 2.34.1