diff options
| author | Chris Lattner <sabre@nondot.org> | 2012-01-25 06:02:56 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2012-01-25 06:02:56 +0000 |
| commit | 47a86bdbe2e5542a35278151a772d4ae7811088d (patch) | |
| tree | 1e34020e9e2f81c25ccb367fa52a3ae528530526 /llvm/lib/Transforms | |
| parent | f07b612313702d86caab5011864140260e12d0bd (diff) | |
| download | bcm5719-llvm-47a86bdbe2e5542a35278151a772d4ae7811088d.tar.gz bcm5719-llvm-47a86bdbe2e5542a35278151a772d4ae7811088d.zip | |
use ConstantVector::getSplat in a few places.
llvm-svn: 148929
Diffstat (limited to 'llvm/lib/Transforms')
3 files changed, 4 insertions, 5 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp b/llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp index 2f82b7b4a91..122f9486c8e 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp +++ b/llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp @@ -698,7 +698,7 @@ Instruction *InstCombiner::visitSRem(BinaryOperator &I) { hasNegative = true; if (hasNegative) { - std::vector<Constant *> Elts(VWidth); + SmallVector<Constant *, 16> Elts(VWidth); for (unsigned i = 0; i != VWidth; ++i) { if (ConstantInt *RHS = dyn_cast<ConstantInt>(RHSV->getOperand(i))) { if (RHS->isNegative()) diff --git a/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp b/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp index ed9442511d2..7b1617d7789 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp +++ b/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp @@ -851,8 +851,8 @@ Value *InstCombiner::SimplifyDemandedVectorElts(Value *V, APInt DemandedElts, } // If we changed the constant, return it. - Constant *NewCP = ConstantVector::get(Elts); - return NewCP != CV ? NewCP : 0; + Constant *NewCV = ConstantVector::get(Elts); + return NewCV != CV ? NewCV : 0; } if (ConstantDataVector *CDV = dyn_cast<ConstantDataVector>(V)) { diff --git a/llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp b/llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp index 43d56ef0997..503d8e23c75 100644 --- a/llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp +++ b/llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp @@ -2157,8 +2157,7 @@ void SROA::RewriteMemIntrinUserOfAlloca(MemIntrinsic *MI, Instruction *Inst, // If the requested value was a vector constant, create it. if (EltTy->isVectorTy()) { unsigned NumElts = cast<VectorType>(EltTy)->getNumElements(); - SmallVector<Constant*, 16> Elts(NumElts, StoreVal); - StoreVal = ConstantVector::get(Elts); + StoreVal = ConstantVector::getSplat(NumElts, StoreVal); } } new StoreInst(StoreVal, EltPtr, MI); |

