Make sure constant bitwidth is <= 64 bit before calling getSExtValue().
authorEvan Cheng <evan.cheng@apple.com>
Tue, 17 Jul 2012 07:47:50 +0000 (07:47 +0000)
committerEvan Cheng <evan.cheng@apple.com>
Tue, 17 Jul 2012 07:47:50 +0000 (07:47 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160350 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/SelectionDAG/TargetLowering.cpp

index 9902ed76fa78990eb9a956f40bd8c1fdad67c829..d439a6f8699c2e5a184d3cb5be15a5e384e314a2 100644 (file)
@@ -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()) {