Do not restrict interleaved unrolling to small loops, depending on the target.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231528 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Olivier Sallenave
2015-03-06 23:12:04 +00:00
parent 05a3f9120a
commit 2f19fc85a4
7 changed files with 99 additions and 0 deletions

View File

@ -4564,6 +4564,14 @@ LoopVectorizationCostModel::selectUnrollFactor(bool OptForSize,
return SmallUF;
}
// Unroll if this is a large loop (small loops are already dealt with by this
// point) that could benefit from interleaved unrolling.
bool HasReductions = (Legal->getReductionVars()->size() > 0);
if (TTI.enableAggressiveInterleaving(HasReductions)) {
DEBUG(dbgs() << "LV: Unrolling to expose ILP.\n");
return UF;
}
DEBUG(dbgs() << "LV: Not Unrolling.\n");
return 1;
}