Trivial patch to speed up legalizing common i64 constants.
authorChris Lattner <sabre@nondot.org>
Tue, 17 Oct 2006 21:47:13 +0000 (21:47 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 17 Oct 2006 21:47:13 +0000 (21:47 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31020 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/SelectionDAG/SelectionDAG.cpp

index a2aee0971920cb38c7499274e11f7e0396777b81..45fd350496c4bbf2f3f340755b3b558c1a8b9026 100644 (file)
@@ -1234,6 +1234,13 @@ SDOperand SelectionDAG::getNode(unsigned Opcode, MVT::ValueType VT,
     if (N2C && N2C->getValue() == 0)
       return N2;
     break;
+  case ISD::OR:
+  case ISD::XOR:
+    // (X ^| 0) -> X.  This commonly occurs when legalizing i64 values, so it's
+    // worth handling here.
+    if (N2C && N2C->getValue() == 0)
+      return N1;
+    break;
   case ISD::FP_ROUND_INREG:
     if (cast<VTSDNode>(N2)->getVT() == VT) return N1;  // Not actually rounding.
     break;