don't use "signed", just something I noticed in patches flying by.
authorChris Lattner <sabre@nondot.org>
Thu, 22 Mar 2012 03:46:58 +0000 (03:46 +0000)
committerChris Lattner <sabre@nondot.org>
Thu, 22 Mar 2012 03:46:58 +0000 (03:46 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153237 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Scalar/ScalarReplAggregates.cpp

index d36a18f21c6fcb57d122eb7628460f4ba67d5e41..4e3486877772057f0ff524ebf7cbb534219fb366 100644 (file)
@@ -574,8 +574,8 @@ void ConvertToScalarInfo::ConvertUsesToScalar(Value *Ptr, AllocaInst *NewAI,
     // transform it into a store of the expanded constant value.
     if (MemSetInst *MSI = dyn_cast<MemSetInst>(User)) {
       assert(MSI->getRawDest() == Ptr && "Consistency error!");
-      signed SNumBytes = cast<ConstantInt>(MSI->getLength())->getSExtValue();
-      if (SNumBytes > 0) {
+     int64_t SNumBytes = cast<ConstantInt>(MSI->getLength())->getSExtValue();
+      if (SNumBytes > 0 && (SNumBytes >> 32) == 0) {
         unsigned NumBytes = static_cast<unsigned>(SNumBytes);
         unsigned Val = cast<ConstantInt>(MSI->getValue())->getZExtValue();