aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen/IntrinsicLowering.cpp
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2006-10-20 07:07:24 +0000
committerReid Spencer <rspencer@reidspencer.com>2006-10-20 07:07:24 +0000
commitb83eb6447ba155342598f0fabe1f08f5baa9164a (patch)
treea5822f5fdac89033b7b16ba8e5aaf1ae10833b1c /lib/CodeGen/IntrinsicLowering.cpp
parent6e7dd9db6bf677c9161a6ecc12f90651cf1231e0 (diff)
downloadexternal_llvm-b83eb6447ba155342598f0fabe1f08f5baa9164a.zip
external_llvm-b83eb6447ba155342598f0fabe1f08f5baa9164a.tar.gz
external_llvm-b83eb6447ba155342598f0fabe1f08f5baa9164a.tar.bz2
For PR950:
This patch implements the first increment for the Signless Types feature. All changes pertain to removing the ConstantSInt and ConstantUInt classes in favor of just using ConstantInt. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31063 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/IntrinsicLowering.cpp')
-rw-r--r--lib/CodeGen/IntrinsicLowering.cpp35
1 files changed, 18 insertions, 17 deletions
diff --git a/lib/CodeGen/IntrinsicLowering.cpp b/lib/CodeGen/IntrinsicLowering.cpp
index 515752e..b5a03fc 100644
--- a/lib/CodeGen/IntrinsicLowering.cpp
+++ b/lib/CodeGen/IntrinsicLowering.cpp
@@ -166,10 +166,10 @@ static Value *LowerBSWAP(Value *V, Instruction *IP) {
Value *Tmp1 = new ShiftInst(Instruction::Shr, V,
ConstantInt::get(Type::UByteTy,24),"bswap.1", IP);
Tmp3 = BinaryOperator::createAnd(Tmp3,
- ConstantUInt::get(Type::UIntTy, 0xFF0000),
+ ConstantInt::get(Type::UIntTy, 0xFF0000),
"bswap.and3", IP);
Tmp2 = BinaryOperator::createAnd(Tmp2,
- ConstantUInt::get(Type::UIntTy, 0xFF00),
+ ConstantInt::get(Type::UIntTy, 0xFF00),
"bswap.and2", IP);
Tmp4 = BinaryOperator::createOr(Tmp4, Tmp3, "bswap.or1", IP);
Tmp2 = BinaryOperator::createOr(Tmp2, Tmp1, "bswap.or2", IP);
@@ -194,23 +194,24 @@ static Value *LowerBSWAP(Value *V, Instruction *IP) {
Value *Tmp1 = new ShiftInst(Instruction::Shr, V,
ConstantInt::get(Type::UByteTy,56),"bswap.1", IP);
Tmp7 = BinaryOperator::createAnd(Tmp7,
- ConstantUInt::get(Type::ULongTy, 0xFF000000000000ULL),
- "bswap.and7", IP);
+ ConstantInt::get(Type::ULongTy,
+ 0xFF000000000000ULL),
+ "bswap.and7", IP);
Tmp6 = BinaryOperator::createAnd(Tmp6,
- ConstantUInt::get(Type::ULongTy, 0xFF0000000000ULL),
- "bswap.and6", IP);
+ ConstantInt::get(Type::ULongTy, 0xFF0000000000ULL),
+ "bswap.and6", IP);
Tmp5 = BinaryOperator::createAnd(Tmp5,
- ConstantUInt::get(Type::ULongTy, 0xFF00000000ULL),
- "bswap.and5", IP);
+ ConstantInt::get(Type::ULongTy, 0xFF00000000ULL),
+ "bswap.and5", IP);
Tmp4 = BinaryOperator::createAnd(Tmp4,
- ConstantUInt::get(Type::ULongTy, 0xFF000000ULL),
- "bswap.and4", IP);
+ ConstantInt::get(Type::ULongTy, 0xFF000000ULL),
+ "bswap.and4", IP);
Tmp3 = BinaryOperator::createAnd(Tmp3,
- ConstantUInt::get(Type::ULongTy, 0xFF0000ULL),
- "bswap.and3", IP);
+ ConstantInt::get(Type::ULongTy, 0xFF0000ULL),
+ "bswap.and3", IP);
Tmp2 = BinaryOperator::createAnd(Tmp2,
- ConstantUInt::get(Type::ULongTy, 0xFF00ULL),
- "bswap.and2", IP);
+ ConstantInt::get(Type::ULongTy, 0xFF00ULL),
+ "bswap.and2", IP);
Tmp8 = BinaryOperator::createOr(Tmp8, Tmp7, "bswap.or1", IP);
Tmp6 = BinaryOperator::createOr(Tmp6, Tmp5, "bswap.or2", IP);
Tmp4 = BinaryOperator::createOr(Tmp4, Tmp3, "bswap.or3", IP);
@@ -247,8 +248,8 @@ static Value *LowerCTPOP(Value *V, Instruction *IP) {
unsigned BitSize = V->getType()->getPrimitiveSizeInBits();
for (unsigned i = 1, ct = 0; i != BitSize; i <<= 1, ++ct) {
Value *MaskCst =
- ConstantExpr::getCast(ConstantUInt::get(Type::ULongTy,
- MaskValues[ct]), V->getType());
+ ConstantExpr::getCast(ConstantInt::get(Type::ULongTy, MaskValues[ct]),
+ V->getType());
Value *LHS = BinaryOperator::createAnd(V, MaskCst, "cppop.and1", IP);
Value *VShift = new ShiftInst(Instruction::Shr, V,
ConstantInt::get(Type::UByteTy, i), "ctpop.sh", IP);
@@ -395,7 +396,7 @@ void DefaultIntrinsicLowering::LowerIntrinsicCall(CallInst *CI) {
case Intrinsic::readcyclecounter: {
std::cerr << "WARNING: this target does not support the llvm.readcyclecoun"
<< "ter intrinsic. It is being lowered to a constant 0\n";
- CI->replaceAllUsesWith(ConstantUInt::get(Type::ULongTy, 0));
+ CI->replaceAllUsesWith(ConstantInt::get(Type::ULongTy, 0));
break;
}