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
This commit is contained in:
Nadav Rotem 2012-11-14 00:02:13 +00:00
parent 242343d1ab
commit e123fd9c59

View File

@ -549,13 +549,7 @@ Value *SingleBlockLoopVectorizer::getVectorValue(Value *V) {
Constant* Constant*
SingleBlockLoopVectorizer::getUniformVector(unsigned Val, Type* ScalarTy) { SingleBlockLoopVectorizer::getUniformVector(unsigned Val, Type* ScalarTy) {
SmallVector<Constant*, 8> Indices; return ConstantVector::getSplat(VF, ConstantInt::get(ScalarTy, Val, true));
// 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);
} }
void SingleBlockLoopVectorizer::scalarizeInstruction(Instruction *Instr) { void SingleBlockLoopVectorizer::scalarizeInstruction(Instruction *Instr) {