summaryrefslogtreecommitdiff
path: root/lib/Transforms/Vectorize/LoopVectorize.cpp
diff options
context:
space:
mode:
authorRenato Golin <renato.golin@linaro.org>2013-10-11 16:14:39 +0000
committerRenato Golin <renato.golin@linaro.org>2013-10-11 16:14:39 +0000
commitde2aa608438c1675bb69c2b2087663b9dfcf752b (patch)
tree1faf3598e8c1707d6ddc1b0b7f3a44ce90efa22d /lib/Transforms/Vectorize/LoopVectorize.cpp
parentfc3dc102e0bef8ecb7cd13ceab77dc130175f792 (diff)
downloadllvm-de2aa608438c1675bb69c2b2087663b9dfcf752b.tar.gz
llvm-de2aa608438c1675bb69c2b2087663b9dfcf752b.tar.bz2
llvm-de2aa608438c1675bb69c2b2087663b9dfcf752b.tar.xz
Better info when debugging vectorizer
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192460 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Vectorize/LoopVectorize.cpp')
-rw-r--r--lib/Transforms/Vectorize/LoopVectorize.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/lib/Transforms/Vectorize/LoopVectorize.cpp b/lib/Transforms/Vectorize/LoopVectorize.cpp
index 415f86e893..a34d5b3fe5 100644
--- a/lib/Transforms/Vectorize/LoopVectorize.cpp
+++ b/lib/Transforms/Vectorize/LoopVectorize.cpp
@@ -2745,19 +2745,17 @@ bool LoopVectorizationLegality::canVectorize() {
if (!TheLoop->getExitingBlock())
return false;
- unsigned NumBlocks = TheLoop->getNumBlocks();
+ // We need to have a loop header.
+ DEBUG(dbgs() << "LV: Found a loop: " <<
+ TheLoop->getHeader()->getName() << '\n');
// Check if we can if-convert non single-bb loops.
+ unsigned NumBlocks = TheLoop->getNumBlocks();
if (NumBlocks != 1 && !canVectorizeWithIfConvert()) {
DEBUG(dbgs() << "LV: Can't if-convert the loop.\n");
return false;
}
- // We need to have a loop header.
- BasicBlock *Latch = TheLoop->getLoopLatch();
- DEBUG(dbgs() << "LV: Found a loop: " <<
- TheLoop->getHeader()->getName() << '\n');
-
// ScalarEvolution needs to be able to find the exit count.
const SCEV *ExitCount = SE->getBackedgeTakenCount(TheLoop);
if (ExitCount == SE->getCouldNotCompute()) {
@@ -2766,6 +2764,7 @@ bool LoopVectorizationLegality::canVectorize() {
}
// Do not loop-vectorize loops with a tiny trip count.
+ BasicBlock *Latch = TheLoop->getLoopLatch();
unsigned TC = SE->getSmallConstantTripCount(TheLoop, Latch);
if (TC > 0u && TC < TinyTripCountVectorThreshold) {
DEBUG(dbgs() << "LV: Found a loop with a very small trip count. " <<