[llvm-commits] [llvm] r167892 - /llvm/trunk/lib/Transforms/Vectorize/LoopVectorize.cpp
Nadav Rotem
nrotem at apple.com
Tue Nov 13 16:02:13 PST 2012
Author: nadav
Date: Tue Nov 13 18:02:13 2012
New Revision: 167892
URL: http://llvm.org/viewvc/llvm-project?rev=167892&view=rev
Log:
use the getSplat API. Patch by Paul Redmond.
Modified:
llvm/trunk/lib/Transforms/Vectorize/LoopVectorize.cpp
Modified: llvm/trunk/lib/Transforms/Vectorize/LoopVectorize.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Vectorize/LoopVectorize.cpp?rev=167892&r1=167891&r2=167892&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Vectorize/LoopVectorize.cpp (original)
+++ llvm/trunk/lib/Transforms/Vectorize/LoopVectorize.cpp Tue Nov 13 18:02:13 2012
@@ -549,13 +549,7 @@
Constant*
SingleBlockLoopVectorizer::getUniformVector(unsigned Val, Type* ScalarTy) {
- SmallVector<Constant*, 8> Indices;
- // Create a vector of consecutive numbers from zero to VF.
- for (unsigned i = 0; i < VF; ++i)
- Indices.push_back(ConstantInt::get(ScalarTy, Val, true));
-
- // Add the consecutive indices to the vector value.
- return ConstantVector::get(Indices);
+ return ConstantVector::getSplat(VF, ConstantInt::get(ScalarTy, Val, true));
}
void SingleBlockLoopVectorizer::scalarizeInstruction(Instruction *Instr) {
More information about the llvm-commits
mailing list