aboutsummaryrefslogtreecommitdiffstats
path: root/lib/VMCore/Instructions.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-03-25 21:54:21 +0000
committerChris Lattner <sabre@nondot.org>2006-03-25 21:54:21 +0000
commitfdbc82a925d3b5180bab13863584edd342c830a4 (patch)
treeb0359bef94175351b44e68cf3ded77e40bbc3d32 /lib/VMCore/Instructions.cpp
parent0a868961d6623518d01d6e447c7812fcf73510df (diff)
downloadexternal_llvm-fdbc82a925d3b5180bab13863584edd342c830a4.tar.gz
external_llvm-fdbc82a925d3b5180bab13863584edd342c830a4.tar.bz2
external_llvm-fdbc82a925d3b5180bab13863584edd342c830a4.zip
Teach BinaryOperator::createNot to work with packed integer types
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27124 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/Instructions.cpp')
-rw-r--r--lib/VMCore/Instructions.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/VMCore/Instructions.cpp b/lib/VMCore/Instructions.cpp
index 0bd55c9151..f28a413a17 100644
--- a/lib/VMCore/Instructions.cpp
+++ b/lib/VMCore/Instructions.cpp
@@ -923,8 +923,15 @@ BinaryOperator *BinaryOperator::createNeg(Value *Op, const std::string &Name,
BinaryOperator *BinaryOperator::createNot(Value *Op, const std::string &Name,
Instruction *InsertBefore) {
- return new BinaryOperator(Instruction::Xor, Op,
- ConstantIntegral::getAllOnesValue(Op->getType()),
+ Constant *C;
+ if (const PackedType *PTy = dyn_cast<PackedType>(Op->getType())) {
+ C = ConstantIntegral::getAllOnesValue(PTy->getElementType());
+ C = ConstantPacked::get(std::vector<Constant*>(PTy->getNumElements(), C));
+ } else {
+ C = ConstantIntegral::getAllOnesValue(Op->getType());
+ }
+
+ return new BinaryOperator(Instruction::Xor, Op, C,
Op->getType(), Name, InsertBefore);
}