summaryrefslogtreecommitdiff
path: root/lib/Transforms/Vectorize
diff options
context:
space:
mode:
authorAlexey Bataev <a.bataev@hotmail.com>2014-04-15 09:37:30 +0000
committerAlexey Bataev <a.bataev@hotmail.com>2014-04-15 09:37:30 +0000
commit15cbb64eb4bb19e3b21e1c75af3096bced18eb2a (patch)
tree9c850430cd3a54474c5db76350e83ae87baf9b46 /lib/Transforms/Vectorize
parent47b284ce3539ef216e0ab994f4b7d762cfb1c69a (diff)
downloadllvm-15cbb64eb4bb19e3b21e1c75af3096bced18eb2a.tar.gz
llvm-15cbb64eb4bb19e3b21e1c75af3096bced18eb2a.tar.bz2
llvm-15cbb64eb4bb19e3b21e1c75af3096bced18eb2a.tar.xz
D3348 - [BUG] "Rotate Loop" pass kills "llvm.vectorizer.enable" metadata
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206266 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Vectorize')
-rw-r--r--lib/Transforms/Vectorize/LoopVectorize.cpp20
1 files changed, 14 insertions, 6 deletions
diff --git a/lib/Transforms/Vectorize/LoopVectorize.cpp b/lib/Transforms/Vectorize/LoopVectorize.cpp
index 9bf5e3ccb6..0c0fd8f27d 100644
--- a/lib/Transforms/Vectorize/LoopVectorize.cpp
+++ b/lib/Transforms/Vectorize/LoopVectorize.cpp
@@ -1067,7 +1067,8 @@ struct LoopVectorize : public FunctionPass {
return false;
if (DL == NULL) {
- DEBUG(dbgs() << "LV: Not vectorizing: Missing data layout\n");
+ DEBUG(dbgs() << "\nLV: Not vectorizing " << F.getName()
+ << ": Missing data layout\n");
return false;
}
@@ -1090,13 +1091,20 @@ struct LoopVectorize : public FunctionPass {
bool processLoop(Loop *L) {
assert(L->empty() && "Only process inner loops.");
- DEBUG(dbgs() << "LV: Checking a loop in \""
+ DEBUG(dbgs() << "\nLV: Checking a loop in \""
<< L->getHeader()->getParent()->getName() << "\" from "
<< getDebugLocString(L->getHeader()->getFirstNonPHIOrDbg())
<< "\n");
LoopVectorizeHints Hints(L, DisableUnrolling);
+ DEBUG(dbgs() << "LV: Loop hints:"
+ << " force=" << (Hints.Force == 0
+ ? "disabled"
+ : (Hints.Force == 1 ? "enabled" : "?"))
+ << " width=" << Hints.Width << " unroll=" << Hints.Unroll
+ << "\n");
+
if (Hints.Force == 0) {
DEBUG(dbgs() << "LV: Not vectorizing: #pragma vectorize disable.\n");
return false;
@@ -1150,10 +1158,10 @@ struct LoopVectorize : public FunctionPass {
}
// Select the optimal vectorization factor.
- LoopVectorizationCostModel::VectorizationFactor VF;
- VF = CM.selectVectorizationFactor(OptForSize, Hints.Width);
+ const LoopVectorizationCostModel::VectorizationFactor VF =
+ CM.selectVectorizationFactor(OptForSize, Hints.Width);
// Select the unroll factor.
- unsigned UF = CM.selectUnrollFactor(OptForSize, Hints.Unroll, VF.Width,
+ const unsigned UF = CM.selectUnrollFactor(OptForSize, Hints.Unroll, VF.Width,
VF.Cost);
DEBUG(dbgs() << "LV: Found a vectorizable loop ("
@@ -5076,7 +5084,7 @@ LoopVectorizationCostModel::selectVectorizationFactor(bool OptForSize,
}
}
- DEBUG(dbgs() << "LV: Selecting VF = : "<< Width << ".\n");
+ DEBUG(dbgs() << "LV: Selecting VF: "<< Width << ".\n");
Factor.Width = Width;
Factor.Cost = Width * Cost;
return Factor;