diff --git a/llvm/lib/Target/ARM/ARMTargetTransformInfo.cpp b/llvm/lib/Target/ARM/ARMTargetTransformInfo.cpp index fdb0ec40cb41f..cecc9544ed835 100644 --- a/llvm/lib/Target/ARM/ARMTargetTransformInfo.cpp +++ b/llvm/lib/Target/ARM/ARMTargetTransformInfo.cpp @@ -66,6 +66,11 @@ extern cl::opt EnableMaskedGatherScatters; extern cl::opt MVEMaxSupportedInterleaveFactor; +static cl::opt ArmForceUnrollThreshold( + "arm-force-unroll-threshold", cl::init(12), cl::Hidden, + cl::desc( + "Threshold for forced unrolling of small loops in Arm architecture")); + /// Convert a vector load intrinsic into a simple llvm load instruction. /// This is beneficial when the underlying object being addressed comes /// from a constant, since we get constant-folding for free. @@ -2731,7 +2736,7 @@ void ARMTTIImpl::getUnrollingPreferences(Loop *L, ScalarEvolution &SE, // Force unrolling small loops can be very useful because of the branch // taken cost of the backedge. - if (Cost < 12) + if (Cost < ArmForceUnrollThreshold) UP.Force = true; }