[llvm-commits] CVS: llvm/lib/Target/X86/X86ISelDAGToDAG.cpp

Evan Cheng evan.cheng at apple.com
Thu Jan 5 17:06:43 PST 2006



Changes in directory llvm/lib/Target/X86:

X86ISelDAGToDAG.cpp updated: 1.21 -> 1.22
---
Log message:

fold (shl x, 1) -> (add x, x)


---
Diffs of the changes:  (+0 -20)

 X86ISelDAGToDAG.cpp |   20 --------------------
 1 files changed, 20 deletions(-)


Index: llvm/lib/Target/X86/X86ISelDAGToDAG.cpp
diff -u llvm/lib/Target/X86/X86ISelDAGToDAG.cpp:1.21 llvm/lib/Target/X86/X86ISelDAGToDAG.cpp:1.22
--- llvm/lib/Target/X86/X86ISelDAGToDAG.cpp:1.21	Wed Jan  4 20:08:37 2006
+++ llvm/lib/Target/X86/X86ISelDAGToDAG.cpp	Thu Jan  5 19:06:31 2006
@@ -363,26 +363,6 @@
   switch (Node->getOpcode()) {
     default: break;
 
-    case ISD::SHL:
-      if (ConstantSDNode *CN = dyn_cast<ConstantSDNode>(Node->getOperand(1))) {
-        if (CN->getValue() == 1) {
-          // X = SHL Y, 1  -> X = ADD Y, Y
-          switch (NVT) {
-            default: assert(0 && "Cannot shift this type!");
-            case MVT::i8:  Opc = X86::ADD8rr; break;
-            case MVT::i16: Opc = X86::ADD16rr; break;
-            case MVT::i32: Opc = X86::ADD32rr; break;
-          }
-          SDOperand Tmp0 = Select(Node->getOperand(0));
-          if (Node->hasOneUse())
-            return CurDAG->SelectNodeTo(Node, Opc, NVT, Tmp0, Tmp0);
-          else
-            return CodeGenMap[N] =
-              CurDAG->getTargetNode(Opc, NVT, Tmp0, Tmp0);
-        }
-      }
-      break;
-
     case ISD::TRUNCATE: {
       unsigned Reg;
       MVT::ValueType VT;






More information about the llvm-commits mailing list