summaryrefslogtreecommitdiff
path: root/lib/Transforms/Vectorize/LoopVectorize.cpp
diff options
context:
space:
mode:
authorRenato Golin <renato.golin@linaro.org>2013-10-24 14:50:51 +0000
committerRenato Golin <renato.golin@linaro.org>2013-10-24 14:50:51 +0000
commitd6aa89eca5be76dece4b4cd44359e8577e587dff (patch)
tree4f1081b8bcd82de6aae2a5f3740c13188112de24 /lib/Transforms/Vectorize/LoopVectorize.cpp
parent43752f2d4f29ebb40318e8da05633c994b694f46 (diff)
downloadllvm-d6aa89eca5be76dece4b4cd44359e8577e587dff.tar.gz
llvm-d6aa89eca5be76dece4b4cd44359e8577e587dff.tar.bz2
llvm-d6aa89eca5be76dece4b4cd44359e8577e587dff.tar.xz
Mark vector loops as already vectorized
Make sure we mark all loops (scalar and vector) when vectorizing, so that we don't try to vectorize them anymore. Also, set unroll to 1, since this is what we check for on early exit. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193349 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Vectorize/LoopVectorize.cpp')
-rw-r--r--lib/Transforms/Vectorize/LoopVectorize.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Transforms/Vectorize/LoopVectorize.cpp b/lib/Transforms/Vectorize/LoopVectorize.cpp
index 72ddb749d6..317c1ffd85 100644
--- a/lib/Transforms/Vectorize/LoopVectorize.cpp
+++ b/lib/Transforms/Vectorize/LoopVectorize.cpp
@@ -801,6 +801,7 @@ struct LoopVectorizeHints {
Vals.push_back(LoopID->getOperand(i));
Vals.push_back(createHint(Context, Twine(Prefix(), "width").str(), Width));
+ Vals.push_back(createHint(Context, Twine(Prefix(), "unroll").str(), 1));
MDNode *NewLoopID = MDNode::get(Context, Vals);
// Set operand 0 to refer to the loop id itself.
@@ -1785,6 +1786,9 @@ InnerLoopVectorizer::createEmptyLoop(LoopVectorizationLegality *Legal) {
LoopExitBlock = ExitBlock;
LoopVectorBody = VecBody;
LoopScalarBody = OldBasicBlock;
+
+ LoopVectorizeHints Hints(Lp, true);
+ Hints.setAlreadyVectorized(Lp);
}
/// This function returns the identity element (or neutral element) for