summaryrefslogtreecommitdiff
path: root/lib/Transforms
diff options
context:
space:
mode:
authorNadav Rotem <nrotem@apple.com>2012-11-14 00:02:13 +0000
committerNadav Rotem <nrotem@apple.com>2012-11-14 00:02:13 +0000
commite123fd9c5956962d414693ee8ad83498413af6ce (patch)
tree9ce55549cf2d627f574c27e936a86a0e7dd769d7 /lib/Transforms
parent242343d1ab0d6b10221569fd2c504842a561f0e7 (diff)
downloadllvm-e123fd9c5956962d414693ee8ad83498413af6ce.tar.gz
llvm-e123fd9c5956962d414693ee8ad83498413af6ce.tar.bz2
llvm-e123fd9c5956962d414693ee8ad83498413af6ce.tar.xz
use the getSplat API. Patch by Paul Redmond.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167892 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms')
-rw-r--r--lib/Transforms/Vectorize/LoopVectorize.cpp8
1 files changed, 1 insertions, 7 deletions
diff --git a/lib/Transforms/Vectorize/LoopVectorize.cpp b/lib/Transforms/Vectorize/LoopVectorize.cpp
index a7ef248e6e..12e4db6b38 100644
--- a/lib/Transforms/Vectorize/LoopVectorize.cpp
+++ b/lib/Transforms/Vectorize/LoopVectorize.cpp
@@ -549,13 +549,7 @@ Value *SingleBlockLoopVectorizer::getVectorValue(Value *V) {
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) {