[llvm-commits] CVS: llvm/lib/CodeGen/IntrinsicLowering.cpp

Reid Spencer reid at x10sys.com
Fri Feb 2 06:09:50 PST 2007



Changes in directory llvm/lib/CodeGen:

IntrinsicLowering.cpp updated: 1.63 -> 1.64
---
Log message:

Use short form of BinaryOperator create function.


---
Diffs of the changes:  (+16 -16)

 IntrinsicLowering.cpp |   32 ++++++++++++++++----------------
 1 files changed, 16 insertions(+), 16 deletions(-)


Index: llvm/lib/CodeGen/IntrinsicLowering.cpp
diff -u llvm/lib/CodeGen/IntrinsicLowering.cpp:1.63 llvm/lib/CodeGen/IntrinsicLowering.cpp:1.64
--- llvm/lib/CodeGen/IntrinsicLowering.cpp:1.63	Thu Feb  1 20:16:22 2007
+++ llvm/lib/CodeGen/IntrinsicLowering.cpp	Fri Feb  2 08:09:34 2007
@@ -118,21 +118,21 @@
   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 @@
     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 @@
   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 @@
   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);
   }
 






More information about the llvm-commits mailing list