[X86] Disable loop unrolling in loop vectorization pass when VF is 1.
authorWei Mi <wmi@google.com>
Wed, 6 May 2015 17:12:25 +0000 (17:12 +0000)
committerWei Mi <wmi@google.com>
Wed, 6 May 2015 17:12:25 +0000 (17:12 +0000)
commitcac51be31f152b736beda01b557546e02a92ee6c
tree847dd53be64d3c7775e50ec8e99a84f648fc6910
parent530a574a9dc6de13fe2bab31a461ba6bdb2a4c54
[X86] Disable loop unrolling in loop vectorization pass when VF is 1.

The patch disabled unrolling in loop vectorization pass when VF==1 on x86 architecture,
by setting MaxInterleaveFactor to 1. Unrolling in loop vectorization pass may introduce
the cost of overflow check, memory boundary check and extra prologue/epilogue code when
regular unroller will unroll the loop another time. Disable it when VF==1 remove the
unnecessary cost on x86. The same can be done for other platforms after verifying
interleaving/memory bound checking to be not perf critical on those platforms.

Differential Revision: http://reviews.llvm.org/D9515

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236613 91177308-0d34-0410-b5e6-96231b3b80d8
16 files changed:
include/llvm/Analysis/TargetTransformInfo.h
include/llvm/Analysis/TargetTransformInfoImpl.h
include/llvm/CodeGen/BasicTTIImpl.h
lib/Analysis/TargetTransformInfo.cpp
lib/Target/AArch64/AArch64TargetTransformInfo.cpp
lib/Target/AArch64/AArch64TargetTransformInfo.h
lib/Target/ARM/ARMTargetTransformInfo.h
lib/Target/PowerPC/PPCTargetTransformInfo.cpp
lib/Target/PowerPC/PPCTargetTransformInfo.h
lib/Target/R600/AMDGPUTargetTransformInfo.cpp
lib/Target/R600/AMDGPUTargetTransformInfo.h
lib/Target/X86/X86TargetTransformInfo.cpp
lib/Target/X86/X86TargetTransformInfo.h
lib/Transforms/Vectorize/LoopVectorize.cpp
test/Transforms/LoopVectorize/X86/unroll-small-loops.ll
test/Transforms/LoopVectorize/unroll.ll [new file with mode: 0644]