diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2012-02-14 12:06:21 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2012-02-14 12:06:21 +0000 |
commit | 14c598268ff7534d3753ae84eba9b8a81bf0bf8f (patch) | |
tree | 9738b30d50ace204cca6c36e30fcbb87f282ca7f /lib/CodeGen/CGExpr.cpp | |
parent | 3164c14cadbb09a05ba811602221e9156077cf44 (diff) |
Use a simpler (and more efficient) pattern to pad vectors.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150475 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGExpr.cpp')
-rw-r--r-- | lib/CodeGen/CGExpr.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/CodeGen/CGExpr.cpp b/lib/CodeGen/CGExpr.cpp index ae4084ba6c..95bed1b0e6 100644 --- a/lib/CodeGen/CGExpr.cpp +++ b/lib/CodeGen/CGExpr.cpp @@ -1181,11 +1181,9 @@ void CodeGenFunction::EmitStoreThroughExtVectorComponentLValue(RValue Src, // FIXME: since we're shuffling with undef, can we just use the indices // into that? This could be simpler. SmallVector<llvm::Constant*, 4> ExtMask; - unsigned i; - for (i = 0; i != NumSrcElts; ++i) + for (unsigned i = 0; i != NumSrcElts; ++i) ExtMask.push_back(Builder.getInt32(i)); - for (; i != NumDstElts; ++i) - ExtMask.push_back(llvm::UndefValue::get(Int32Ty)); + ExtMask.resize(NumDstElts, llvm::UndefValue::get(Int32Ty)); llvm::Value *ExtMaskV = llvm::ConstantVector::get(ExtMask); llvm::Value *ExtSrcVal = Builder.CreateShuffleVector(SrcVal, |