From: Evan Cheng Date: Tue, 17 Jul 2012 07:47:50 +0000 (+0000) Subject: Make sure constant bitwidth is <= 64 bit before calling getSExtValue(). X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=b4d4959fdda7afdf7994d3cb0b20c052ad0c7895;p=oota-llvm.git Make sure constant bitwidth is <= 64 bit before calling getSExtValue(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160350 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/SelectionDAG/TargetLowering.cpp b/lib/CodeGen/SelectionDAG/TargetLowering.cpp index 9902ed76fa7..d439a6f8699 100644 --- a/lib/CodeGen/SelectionDAG/TargetLowering.cpp +++ b/lib/CodeGen/SelectionDAG/TargetLowering.cpp @@ -2323,7 +2323,8 @@ TargetLowering::SimplifySetCC(EVT VT, SDValue N0, SDValue N1, } } - if (!isLegalICmpImmediate(C1.getSExtValue())) { + if (C1.getMinSignedBits() <= 64 && + !isLegalICmpImmediate(C1.getSExtValue())) { // (X & -256) == 256 -> (X >> 8) == 1 if ((Cond == ISD::SETEQ || Cond == ISD::SETNE) && N0.getOpcode() == ISD::AND && N0.hasOneUse()) {