[llvm-commits] CVS: llvm/lib/Transforms/Utils/Linker.cpp Local.cpp ValueMapper.cpp

Chris Lattner lattner at cs.uiuc.edu
Mon Jan 12 13:12:05 PST 2004


Changes in directory llvm/lib/Transforms/Utils:

Linker.cpp updated: 1.65 -> 1.66
Local.cpp updated: 1.15 -> 1.16
ValueMapper.cpp updated: 1.9 -> 1.10

---
Log message:

Remove use of ConstantExpr::getShift


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

Index: llvm/lib/Transforms/Utils/Linker.cpp
diff -u llvm/lib/Transforms/Utils/Linker.cpp:1.65 llvm/lib/Transforms/Utils/Linker.cpp:1.66
--- llvm/lib/Transforms/Utils/Linker.cpp:1.65	Fri Jan  9 00:12:24 2004
+++ llvm/lib/Transforms/Utils/Linker.cpp	Mon Jan 12 13:10:58 2004
@@ -324,12 +324,6 @@
         assert(CE->getOpcode() == Instruction::Cast);
         Value *V = RemapOperand(CE->getOperand(0), LocalMap, GlobalMap);
         Result = ConstantExpr::getCast(cast<Constant>(V), CE->getType());
-      } else if (CE->getOpcode() == Instruction::Shl ||
-                 CE->getOpcode() == Instruction::Shr) {      // Shift
-        Value *V1 = RemapOperand(CE->getOperand(0), LocalMap, GlobalMap);
-        Value *V2 = RemapOperand(CE->getOperand(1), LocalMap, GlobalMap);
-        Result = ConstantExpr::getShift(CE->getOpcode(), cast<Constant>(V1),
-                                        cast<Constant>(V2));
       } else if (CE->getNumOperands() == 2) {
         // Binary operator...
         Value *V1 = RemapOperand(CE->getOperand(0), LocalMap, GlobalMap);


Index: llvm/lib/Transforms/Utils/Local.cpp
diff -u llvm/lib/Transforms/Utils/Local.cpp:1.15 llvm/lib/Transforms/Utils/Local.cpp:1.16
--- llvm/lib/Transforms/Utils/Local.cpp:1.15	Mon Jan 12 12:35:03 2004
+++ llvm/lib/Transforms/Utils/Local.cpp	Mon Jan 12 13:10:58 2004
@@ -74,16 +74,13 @@
   case 0: return 0;
   }
 
-  if (isa<BinaryOperator>(I))
+  if (isa<BinaryOperator>(I) || isa<ShiftInst>(I))
     return ConstantExpr::get(I->getOpcode(), Op0, Op1);    
 
   switch (I->getOpcode()) {
   default: return 0;
   case Instruction::Cast:
     return ConstantExpr::getCast(Op0, I->getType());
-  case Instruction::Shl:
-  case Instruction::Shr:
-    return ConstantExpr::getShift(I->getOpcode(), Op0, Op1);
   case Instruction::GetElementPtr:
     std::vector<Constant*> IdxList;
     IdxList.reserve(I->getNumOperands()-1);


Index: llvm/lib/Transforms/Utils/ValueMapper.cpp
diff -u llvm/lib/Transforms/Utils/ValueMapper.cpp:1.9 llvm/lib/Transforms/Utils/ValueMapper.cpp:1.10
--- llvm/lib/Transforms/Utils/ValueMapper.cpp:1.9	Fri Jan  9 00:12:25 2004
+++ llvm/lib/Transforms/Utils/ValueMapper.cpp	Mon Jan 12 13:10:58 2004
@@ -83,12 +83,6 @@
         for (unsigned i = 1, e = CE->getNumOperands(); i != e; ++i)
           Idx.push_back(cast<Constant>(MapValue(CE->getOperand(i), VM)));
         return VMSlot = ConstantExpr::getGetElementPtr(MV, Idx);
-      } else if (CE->getOpcode() == Instruction::Shl ||
-                 CE->getOpcode() == Instruction::Shr) {
-        assert(CE->getNumOperands() == 2 && "Must be a shift!");
-        Constant *MV1 = cast<Constant>(MapValue(CE->getOperand(0), VM));
-        Constant *MV2 = cast<Constant>(MapValue(CE->getOperand(1), VM));
-        return VMSlot = ConstantExpr::getShift(CE->getOpcode(), MV1, MV2);
       } else {
         assert(CE->getNumOperands() == 2 && "Must be binary operator?");
         Constant *MV1 = cast<Constant>(MapValue(CE->getOperand(0), VM));





More information about the llvm-commits mailing list