shift X, 0 -> X

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19453 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2005-01-11 04:25:13 +00:00
parent 6c07aee7c9
commit a8d9cc8705

View 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())