[cfe-commits] r170100 - /cfe/trunk/lib/CodeGen/CGExpr.cpp
Richard Smith
richard-llvm at metafoo.co.uk
Wed Dec 12 21:41:48 PST 2012
Author: rsmith
Date: Wed Dec 12 23:41:48 2012
New Revision: 170100
URL: http://llvm.org/viewvc/llvm-project?rev=170100&view=rev
Log:
Simplify. No functionality change.
Modified:
cfe/trunk/lib/CodeGen/CGExpr.cpp
Modified: cfe/trunk/lib/CodeGen/CGExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGExpr.cpp?rev=170100&r1=170099&r2=170100&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGExpr.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGExpr.cpp Wed Dec 12 23:41:48 2012
@@ -987,19 +987,14 @@
"castToVec4");
// Now load value.
llvm::Value *LoadVal = Builder.CreateLoad(Cast, Volatile, "loadVec4");
-
+
// Shuffle vector to get vec3.
- llvm::SmallVector<llvm::Constant*, 3> Mask;
- Mask.push_back(llvm::ConstantInt::get(
- llvm::Type::getInt32Ty(getLLVMContext()),
- 0));
- Mask.push_back(llvm::ConstantInt::get(
- llvm::Type::getInt32Ty(getLLVMContext()),
- 1));
- Mask.push_back(llvm::ConstantInt::get(
- llvm::Type::getInt32Ty(getLLVMContext()),
- 2));
-
+ llvm::Constant *Mask[] = {
+ llvm::ConstantInt::get(llvm::Type::getInt32Ty(getLLVMContext()), 0),
+ llvm::ConstantInt::get(llvm::Type::getInt32Ty(getLLVMContext()), 1),
+ llvm::ConstantInt::get(llvm::Type::getInt32Ty(getLLVMContext()), 2)
+ };
+
llvm::Value *MaskV = llvm::ConstantVector::get(Mask);
V = Builder.CreateShuffleVector(LoadVal,
llvm::UndefValue::get(vec4Ty),
More information about the cfe-commits
mailing list