mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-23 14:25:07 +00:00
[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
This commit is contained in:
@@ -66,7 +66,13 @@ unsigned X86TTIImpl::getRegisterBitWidth(bool Vector) {
|
||||
|
||||
}
|
||||
|
||||
unsigned X86TTIImpl::getMaxInterleaveFactor() {
|
||||
unsigned X86TTIImpl::getMaxInterleaveFactor(unsigned VF) {
|
||||
// If the loop will not be vectorized, don't interleave the loop.
|
||||
// Let regular unroll to unroll the loop, which saves the overflow
|
||||
// check and memory check cost.
|
||||
if (VF == 1)
|
||||
return 1;
|
||||
|
||||
if (ST->isAtom())
|
||||
return 1;
|
||||
|
||||
|
Reference in New Issue
Block a user