Use isIntN and isUIntN to check for valid signed/unsigned numbers.
authorBob Wilson <bob.wilson@apple.com>
Tue, 18 Oct 2011 18:46:49 +0000 (18:46 +0000)
committerBob Wilson <bob.wilson@apple.com>
Tue, 18 Oct 2011 18:46:49 +0000 (18:46 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142395 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/ARM/ARMISelLowering.cpp

index c6b9dcc1c467ccd22dd788f9eb7b262e9aff1c27..04b91398156a4c8166529a64e025b8076dcda087 100644 (file)
@@ -4526,11 +4526,10 @@ static bool isExtendedBUILD_VECTOR(SDNode *N, SelectionDAG &DAG,
       unsigned EltSize = VT.getVectorElementType().getSizeInBits();
       unsigned HalfSize = EltSize / 2;
       if (isSigned) {
-        int64_t SExtVal = C->getSExtValue();
-        if (SExtVal != SExtVal << (64 - HalfSize) >> (64 - HalfSize))
+        if (!isIntN(HalfSize, C->getSExtValue()))
           return false;
       } else {
-        if ((C->getZExtValue() >> HalfSize) != 0)
+        if (!isUIntN(HalfSize, C->getZExtValue()))
           return false;
       }
       continue;