Index: include/llvm/Analysis/TargetTransformInfo.h =================================================================== --- include/llvm/Analysis/TargetTransformInfo.h +++ include/llvm/Analysis/TargetTransformInfo.h @@ -346,10 +346,10 @@ /// \return The width of the largest scalar or vector register type. virtual unsigned getRegisterBitWidth(bool Vector) const; - /// \return The maximum unroll factor that the vectorizer should try to + /// \return The maximum unroll factor that the loop vectorizer should try to /// perform for this target. This number depends on the level of parallelism /// and the number of execution units in the CPU. - virtual unsigned getMaximumUnrollFactor() const; + virtual unsigned getMaxVectorUnrollFactor() const; /// \return The expected cost of arithmetic ops, such as mul, xor, fsub, etc. virtual unsigned Index: lib/Analysis/TargetTransformInfo.cpp =================================================================== --- lib/Analysis/TargetTransformInfo.cpp +++ lib/Analysis/TargetTransformInfo.cpp @@ -167,8 +167,8 @@ return PrevTTI->getRegisterBitWidth(Vector); } -unsigned TargetTransformInfo::getMaximumUnrollFactor() const { - return PrevTTI->getMaximumUnrollFactor(); +unsigned TargetTransformInfo::getMaxVectorUnrollFactor() const { + return PrevTTI->getMaxVectorUnrollFactor(); } unsigned TargetTransformInfo::getArithmeticInstrCost( @@ -565,7 +565,7 @@ return 32; } - unsigned getMaximumUnrollFactor() const override { + unsigned getMaxVectorUnrollFactor() const override { return 1; } Index: lib/CodeGen/BasicTargetTransformInfo.cpp =================================================================== --- lib/CodeGen/BasicTargetTransformInfo.cpp +++ lib/CodeGen/BasicTargetTransformInfo.cpp @@ -101,7 +101,7 @@ /// @{ unsigned getNumberOfRegisters(bool Vector) const override; - unsigned getMaximumUnrollFactor() const override; + unsigned getMaxVectorUnrollFactor() const override; unsigned getRegisterBitWidth(bool Vector) const override; unsigned getArithmeticInstrCost(unsigned Opcode, Type *Ty, OperandValueKind, OperandValueKind, OperandValueProperties, @@ -285,7 +285,7 @@ return 32; } -unsigned BasicTTI::getMaximumUnrollFactor() const { +unsigned BasicTTI::getMaxVectorUnrollFactor() const { return 1; } Index: lib/Target/AArch64/AArch64TargetTransformInfo.cpp =================================================================== --- lib/Target/AArch64/AArch64TargetTransformInfo.cpp +++ lib/Target/AArch64/AArch64TargetTransformInfo.cpp @@ -104,7 +104,7 @@ return 64; } - unsigned getMaximumUnrollFactor() const override; + unsigned getMaxVectorUnrollFactor() const override; unsigned getCastInstrCost(unsigned Opcode, Type *Dst, Type *Src) const override; @@ -516,7 +516,7 @@ return Cost; } -unsigned AArch64TTI::getMaximumUnrollFactor() const { +unsigned AArch64TTI::getMaxVectorUnrollFactor() const { if (ST->isCortexA57() || ST->isCyclone()) return 4; return 2; Index: lib/Target/ARM/ARMTargetTransformInfo.cpp =================================================================== --- lib/Target/ARM/ARMTargetTransformInfo.cpp +++ lib/Target/ARM/ARMTargetTransformInfo.cpp @@ -104,7 +104,7 @@ return 32; } - unsigned getMaximumUnrollFactor() const override { + unsigned getMaxVectorUnrollFactor() const override { // These are out of order CPUs: if (ST->isCortexA15() || ST->isSwift()) return 2; Index: lib/Target/PowerPC/PPCTargetTransformInfo.cpp =================================================================== --- lib/Target/PowerPC/PPCTargetTransformInfo.cpp +++ lib/Target/PowerPC/PPCTargetTransformInfo.cpp @@ -91,7 +91,7 @@ virtual unsigned getNumberOfRegisters(bool Vector) const override; virtual unsigned getRegisterBitWidth(bool Vector) const override; - virtual unsigned getMaximumUnrollFactor() const override; + virtual unsigned getMaxVectorUnrollFactor() const override; virtual unsigned getArithmeticInstrCost(unsigned Opcode, Type *Ty, OperandValueKind, OperandValueKind, OperandValueProperties, @@ -298,7 +298,7 @@ } -unsigned PPCTTI::getMaximumUnrollFactor() const { +unsigned PPCTTI::getMaxVectorUnrollFactor() const { unsigned Directive = ST->getDarwinDirective(); // The 440 has no SIMD support, but floating-point instructions // have a 5-cycle latency, so unroll by 5x for latency hiding. Index: lib/Target/R600/AMDGPUTargetTransformInfo.cpp =================================================================== --- lib/Target/R600/AMDGPUTargetTransformInfo.cpp +++ lib/Target/R600/AMDGPUTargetTransformInfo.cpp @@ -81,7 +81,7 @@ unsigned getNumberOfRegisters(bool Vector) const override; unsigned getRegisterBitWidth(bool Vector) const override; - unsigned getMaximumUnrollFactor() const override; + unsigned getMaxVectorUnrollFactor() const override; /// @} }; @@ -153,7 +153,7 @@ return 32; } -unsigned AMDGPUTTI::getMaximumUnrollFactor() const { +unsigned AMDGPUTTI::getMaxVectorUnrollFactor() const { // Semi-arbitrary large amount. return 64; } Index: lib/Target/X86/X86TargetTransformInfo.cpp =================================================================== --- lib/Target/X86/X86TargetTransformInfo.cpp +++ lib/Target/X86/X86TargetTransformInfo.cpp @@ -82,7 +82,7 @@ unsigned getNumberOfRegisters(bool Vector) const override; unsigned getRegisterBitWidth(bool Vector) const override; - unsigned getMaximumUnrollFactor() const override; + unsigned getMaxVectorUnrollFactor() const override; unsigned getArithmeticInstrCost(unsigned Opcode, Type *Ty, OperandValueKind, OperandValueKind, OperandValueProperties, OperandValueProperties) const override; @@ -167,7 +167,7 @@ } -unsigned X86TTI::getMaximumUnrollFactor() const { +unsigned X86TTI::getMaxVectorUnrollFactor() const { if (ST->isAtom()) return 1; Index: lib/Transforms/Vectorize/LoopVectorize.cpp =================================================================== --- lib/Transforms/Vectorize/LoopVectorize.cpp +++ lib/Transforms/Vectorize/LoopVectorize.cpp @@ -5501,7 +5501,7 @@ std::max(1U, (R.MaxLocalUsers - 1))); // Clamp the unroll factor ranges to reasonable factors. - unsigned MaxUnrollSize = TTI.getMaximumUnrollFactor(); + unsigned MaxUnrollSize = TTI.getMaxVectorUnrollFactor(); // Check if the user has overridden the unroll max. if (VF == 1) {