Fix DeadStoreElimination/2004-11-28-LiveStoreDeleted.ll
authorChris Lattner <sabre@nondot.org>
Sun, 28 Nov 2004 20:30:15 +0000 (20:30 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 28 Nov 2004 20:30:15 +0000 (20:30 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18308 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/BasicAliasAnalysis.cpp

index b195b25cb5b09ad68593b64ce5fe88f67e1a54c9..17539bd5315eb4a28d47cdf72b59dc3f497ed504 100644 (file)
@@ -297,7 +297,7 @@ BasicAliasAnalysis::alias(const Value *V1, unsigned V1Size,
         // undefined to load or store bytes before or after an object).
         const Type *ElTy = cast<PointerType>(O1->getType())->getElementType();
         unsigned GlobalSize = getTargetData().getTypeSize(ElTy);
-        if (GlobalSize < V2Size)
+        if (GlobalSize < V2Size && V2Size != ~0U)
           return NoAlias;
       }
   }
@@ -313,7 +313,7 @@ BasicAliasAnalysis::alias(const Value *V1, unsigned V1Size,
         // undefined to load or store bytes before or after an object).
         const Type *ElTy = cast<PointerType>(O2->getType())->getElementType();
         unsigned GlobalSize = getTargetData().getTypeSize(ElTy);
-        if (GlobalSize < V1Size)
+        if (GlobalSize < V1Size && V1Size != ~0U)
           return NoAlias;
       }
   }
@@ -496,7 +496,7 @@ CheckGEPInstructions(const Type* BasePtr1Ty, std::vector<Value*> &GEP1Ops,
   //        A[i][0] != A[j][1] iff (&A[0][1]-&A[0][0] >= std::max(G1S, G2S))
   //
   unsigned SizeMax = std::max(G1S, G2S);
-  if (SizeMax == ~0U) return MayAlias; // Avoid frivolous work...
+  if (SizeMax == ~0U) return MayAlias; // Avoid frivolous work.
 
   // Scan for the first operand that is constant and unequal in the
   // two getelementptrs...