diff --git a/lib/Target/AArch64/AArch64TargetTransformInfo.cpp b/lib/Target/AArch64/AArch64TargetTransformInfo.cpp index 2058dd06b21..24cb129b0b7 100644 --- a/lib/Target/AArch64/AArch64TargetTransformInfo.cpp +++ b/lib/Target/AArch64/AArch64TargetTransformInfo.cpp @@ -104,7 +104,7 @@ public: return 64; } - unsigned getMaximumUnrollFactor() const override { return 2; } + unsigned getMaximumUnrollFactor() const override; unsigned getCastInstrCost(unsigned Opcode, Type *Dst, Type *Src) const override; @@ -513,3 +513,9 @@ unsigned AArch64TTI::getCostOfKeepingLiveOverCall(ArrayRef Tys) const { } return Cost; } + +unsigned AArch64TTI::getMaximumUnrollFactor() const { + if (ST->isCortexA57() || ST->isCyclone()) + return 4; + return 2; +}