Use the autogenerated matcher for ADD/SUB
authorChris Lattner <sabre@nondot.org>
Wed, 28 Sep 2005 22:47:28 +0000 (22:47 +0000)
committerChris Lattner <sabre@nondot.org>
Wed, 28 Sep 2005 22:47:28 +0000 (22:47 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23510 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/PowerPC/PPCISelDAGToDAG.cpp

index 40f9945d5861c78421b9c94e7e37fe8b5b1a73df..0fd4e027f588f748cecfe4be1d57f7ad1870348d 100644 (file)
@@ -767,16 +767,6 @@ SDOperand PPC32DAGToDAGISel::Select(SDOperand Op) {
     CurDAG->SelectNodeTo(N, PPC::FCTIWZ, N->getValueType(0),
                          Select(N->getOperand(0)));
     return SDOperand(N, 0);
-  case ISD::ADD:
-    if (SDNode *I = SelectIntImmediateExpr(N->getOperand(0), N->getOperand(1),
-                                           PPC::ADDIS, PPC::ADDI, true)) {
-      CurDAG->ReplaceAllUsesWith(Op, SDOperand(I, 0));
-      N = I;
-    } else {
-      CurDAG->SelectNodeTo(N, PPC::ADD, MVT::i32, Select(N->getOperand(0)),
-                           Select(N->getOperand(1)));
-    }
-    return SDOperand(N, 0);
   case ISD::FADD: {
     MVT::ValueType Ty = N->getValueType(0);
     if (!NoExcessFPPrecision) {  // Match FMA ops
@@ -803,26 +793,6 @@ SDOperand PPC32DAGToDAGISel::Select(SDOperand Op) {
                          Select(N->getOperand(0)), Select(N->getOperand(1)));
     return SDOperand(N, 0);
   }
-  case ISD::SUB: {
-    unsigned Imm;
-    if (isIntImmediate(N->getOperand(0), Imm) && isInt16(Imm)) {
-      if (0 == Imm)
-        CurDAG->SelectNodeTo(N, PPC::NEG, MVT::i32, Select(N->getOperand(1)));
-      else
-        CurDAG->SelectNodeTo(N, PPC::SUBFIC, MVT::i32, Select(N->getOperand(1)),
-                             getI32Imm(Lo16(Imm)));
-      return SDOperand(N, 0);
-    }
-    if (SDNode *I = SelectIntImmediateExpr(N->getOperand(0), N->getOperand(1),
-                                           PPC::ADDIS, PPC::ADDI, true, true)) {
-      CurDAG->ReplaceAllUsesWith(Op, SDOperand(I, 0));
-      N = I;
-    } else {
-      CurDAG->SelectNodeTo(N, PPC::SUBF, MVT::i32, Select(N->getOperand(1)),
-                           Select(N->getOperand(0)));
-    }
-    return SDOperand(N, 0);
-  }    
   case ISD::FSUB: {
     MVT::ValueType Ty = N->getValueType(0);