avoid work when possible, perhaps fix the problem nate and andrew are seeing
authorChris Lattner <sabre@nondot.org>
Wed, 13 Apr 2005 19:41:05 +0000 (19:41 +0000)
committerChris Lattner <sabre@nondot.org>
Wed, 13 Apr 2005 19:41:05 +0000 (19:41 +0000)
with != 0 comparisons vanishing.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21287 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/SelectionDAG/SelectionDAG.cpp

index 48e0f7bc9ad435d0872c7f5fe604a91bb96230c9..4b3064593c78edd1175eafab3a3ca933f71bbbaa 100644 (file)
@@ -286,6 +286,7 @@ SelectionDAG::~SelectionDAG() {
 }
 
 SDOperand SelectionDAG::getZeroExtendInReg(SDOperand Op, MVT::ValueType VT) {
+  if (Op.getValueType() == VT) return Op;
   int64_t Imm = ~0ULL >> 64-MVT::getSizeInBits(VT);
   return getNode(ISD::AND, Op.getValueType(), Op,
                  getConstant(Imm, Op.getValueType()));