Index: lib/Target/AArch64/AArch64SchedA57.td =================================================================== --- lib/Target/AArch64/AArch64SchedA57.td +++ lib/Target/AArch64/AArch64SchedA57.td @@ -26,6 +26,10 @@ 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 unroll. The magic number is chosen based on + // experiments and benchmarking data. + let LoopMicroOpBufferSize = 16; } //===----------------------------------------------------------------------===// Index: lib/Target/AArch64/AArch64TargetTransformInfo.cpp =================================================================== --- lib/Target/AArch64/AArch64TargetTransformInfo.cpp +++ lib/Target/AArch64/AArch64TargetTransformInfo.cpp @@ -128,6 +128,10 @@ unsigned getCostOfKeepingLiveOverCall(ArrayRef Tys) const override; + void getUnrollingPreferences(const Function *F, Loop *L, + UnrollingPreferences &UP) const override; + + /// @} }; @@ -544,3 +548,9 @@ return 4; return 2; } + +void AArch64TTI::getUnrollingPreferences(const Function *F, Loop *L, + UnrollingPreferences &UP) const { + //Disable partial & runtime unrolling on -Os. + UP.PartialOptSizeThreshold = 0; +}