diff options
author | Reid Spencer <rspencer@reidspencer.com> | 2007-02-02 14:09:34 +0000 |
---|---|---|
committer | Reid Spencer <rspencer@reidspencer.com> | 2007-02-02 14:09:34 +0000 |
commit | 1b19cd35fe86810c9f3c56e5dd577bd3c8520231 (patch) | |
tree | c9544b4b5956acceae648bf002b2dc69c0a5a1c6 /lib/CodeGen | |
parent | cc46cdb47cd0ba2ddbdfd20573a80084eefa9fba (diff) |
Use short form of BinaryOperator create function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33784 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r-- | lib/CodeGen/IntrinsicLowering.cpp | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/lib/CodeGen/IntrinsicLowering.cpp b/lib/CodeGen/IntrinsicLowering.cpp index 7bbe297910..ee2f79e5b5 100644 --- a/lib/CodeGen/IntrinsicLowering.cpp +++ b/lib/CodeGen/IntrinsicLowering.cpp @@ -118,21 +118,21 @@ static Value *LowerBSWAP(Value *V, Instruction *IP) { switch(BitSize) { default: assert(0 && "Unhandled type size of value to byteswap!"); case 16: { - Value *Tmp1 = BinaryOperator::create(Instruction::Shl, V, + Value *Tmp1 = BinaryOperator::createShl(V, ConstantInt::get(V->getType(),8),"bswap.2",IP); - Value *Tmp2 = BinaryOperator::create(Instruction::LShr, V, + Value *Tmp2 = BinaryOperator::createLShr(V, ConstantInt::get(V->getType(),8),"bswap.1",IP); V = BinaryOperator::createOr(Tmp1, Tmp2, "bswap.i16", IP); break; } case 32: { - Value *Tmp4 = BinaryOperator::create(Instruction::Shl, V, + Value *Tmp4 = BinaryOperator::createShl(V, ConstantInt::get(V->getType(),24),"bswap.4", IP); - Value *Tmp3 = BinaryOperator::create(Instruction::Shl, V, + Value *Tmp3 = BinaryOperator::createShl(V, ConstantInt::get(V->getType(),8),"bswap.3",IP); - Value *Tmp2 = BinaryOperator::create(Instruction::LShr, V, + Value *Tmp2 = BinaryOperator::createLShr(V, ConstantInt::get(V->getType(),8),"bswap.2",IP); - Value *Tmp1 = BinaryOperator::create(Instruction::LShr, V, + Value *Tmp1 = BinaryOperator::createLShr(V, ConstantInt::get(V->getType(),24),"bswap.1", IP); Tmp3 = BinaryOperator::createAnd(Tmp3, ConstantInt::get(Type::Int32Ty, 0xFF0000), @@ -146,21 +146,21 @@ static Value *LowerBSWAP(Value *V, Instruction *IP) { break; } case 64: { - Value *Tmp8 = BinaryOperator::create(Instruction::Shl, V, + Value *Tmp8 = BinaryOperator::createShl(V, ConstantInt::get(V->getType(),56),"bswap.8", IP); - Value *Tmp7 = BinaryOperator::create(Instruction::Shl, V, + Value *Tmp7 = BinaryOperator::createShl(V, ConstantInt::get(V->getType(),40),"bswap.7", IP); - Value *Tmp6 = BinaryOperator::create(Instruction::Shl, V, + Value *Tmp6 = BinaryOperator::createShl(V, ConstantInt::get(V->getType(),24),"bswap.6", IP); - Value *Tmp5 = BinaryOperator::create(Instruction::Shl, V, + Value *Tmp5 = BinaryOperator::createShl(V, ConstantInt::get(V->getType(),8),"bswap.5", IP); - Value* Tmp4 = BinaryOperator::create(Instruction::LShr, V, + Value* Tmp4 = BinaryOperator::createLShr(V, ConstantInt::get(V->getType(),8),"bswap.4", IP); - Value* Tmp3 = BinaryOperator::create(Instruction::LShr, V, + Value* Tmp3 = BinaryOperator::createLShr(V, ConstantInt::get(V->getType(),24),"bswap.3", IP); - Value* Tmp2 = BinaryOperator::create(Instruction::LShr, V, + Value* Tmp2 = BinaryOperator::createLShr(V, ConstantInt::get(V->getType(),40),"bswap.2", IP); - Value* Tmp1 = BinaryOperator::create(Instruction::LShr, V, + Value* Tmp1 = BinaryOperator::createLShr(V, ConstantInt::get(V->getType(),56),"bswap.1", IP); Tmp7 = BinaryOperator::createAnd(Tmp7, ConstantInt::get(Type::Int64Ty, @@ -210,7 +210,7 @@ static Value *LowerCTPOP(Value *V, Instruction *IP) { for (unsigned i = 1, ct = 0; i != BitSize; i <<= 1, ++ct) { Value *MaskCst = ConstantInt::get(V->getType(), MaskValues[ct]); Value *LHS = BinaryOperator::createAnd(V, MaskCst, "cppop.and1", IP); - Value *VShift = BinaryOperator::create(Instruction::LShr, V, + Value *VShift = BinaryOperator::createLShr(V, ConstantInt::get(V->getType(), i), "ctpop.sh", IP); Value *RHS = BinaryOperator::createAnd(VShift, MaskCst, "cppop.and2", IP); V = BinaryOperator::createAdd(LHS, RHS, "ctpop.step", IP); @@ -226,7 +226,7 @@ static Value *LowerCTLZ(Value *V, Instruction *IP) { unsigned BitSize = V->getType()->getPrimitiveSizeInBits(); for (unsigned i = 1; i != BitSize; i <<= 1) { Value *ShVal = ConstantInt::get(V->getType(), i); - ShVal = BinaryOperator::create(Instruction::LShr, V, ShVal, "ctlz.sh", IP); + ShVal = BinaryOperator::createLShr(V, ShVal, "ctlz.sh", IP); V = BinaryOperator::createOr(V, ShVal, "ctlz.step", IP); } |