shift X, 0 -> X
authorChris Lattner <sabre@nondot.org>
Tue, 11 Jan 2005 04:25:13 +0000 (04:25 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 11 Jan 2005 04:25:13 +0000 (04:25 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19453 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/SelectionDAG/SelectionDAG.cpp

index d173a95fcd4b9da07365842608c42bbe339689a2..ef0b0769a065ccc7f57da2abd462d3222e0ec0fc 100644 (file)
@@ -612,6 +612,12 @@ SDOperand SelectionDAG::getNode(unsigned Opcode, MVT::ValueType VT,
       }
       break;
 
+    case ISD::SHL:
+    case ISD::SRL:
+    case ISD::SRA:
+      if (C2 == 0) return N1;
+      break;
+
     case ISD::AND:
       if (!C2) return N2;         // X and 0 -> 0
       if (N2C->isAllOnesValue())