From e07bc28cca474be58054274a2995cd58517c1cd5 Mon Sep 17 00:00:00 2001 From: Nate Begeman Date: Wed, 31 Aug 2005 00:27:53 +0000 Subject: [PATCH] Remove some unnecessary casts, and add the AssertZext case to MaskedValueIsZero. llvm-svn: 23164 --- llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp index 9158f7807181..c550e68e8300 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp @@ -1095,6 +1095,7 @@ static bool MaskedValueIsZero(const SDOperand &Op, uint64_t Mask, SrcBits = MVT::getSizeInBits(cast(Op.getOperand(3))->getVT()); return (Mask & ((1ULL << SrcBits)-1)) == 0; // Returning only the zext bits. case ISD::ZERO_EXTEND: + case ISD::AssertZext: SrcBits = MVT::getSizeInBits(Op.getOperand(0).getValueType()); return MaskedValueIsZero(Op.getOperand(0),Mask & ((1ULL << SrcBits)-1),TLI); @@ -1228,8 +1229,8 @@ SDOperand SelectionDAG::getNode(unsigned Opcode, MVT::ValueType VT, case ISD::AND : return getConstant(C1 & C2, VT); case ISD::OR : return getConstant(C1 | C2, VT); case ISD::XOR : return getConstant(C1 ^ C2, VT); - case ISD::SHL : return getConstant(C1 << (int)C2, VT); - case ISD::SRL : return getConstant(C1 >> (unsigned)C2, VT); + case ISD::SHL : return getConstant(C1 << C2, VT); + case ISD::SRL : return getConstant(C1 >> C2, VT); case ISD::SRA : return getConstant(N1C->getSignExtended() >>(int)C2, VT); default: break; }