avoid work when possible, perhaps fix the problem nate and andrew are seeing
with != 0 comparisons vanishing.
llvm-svn: 21287
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
index 48e0f7b..4b30645 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
@@ -286,6 +286,7 @@
}
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()));