Fix DeadStoreElimination/2004-11-28-LiveStoreDeleted.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18308 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Analysis/BasicAliasAnalysis.cpp b/lib/Analysis/BasicAliasAnalysis.cpp
index b195b25..17539bd 100644
--- a/lib/Analysis/BasicAliasAnalysis.cpp
+++ b/lib/Analysis/BasicAliasAnalysis.cpp
@@ -297,7 +297,7 @@
// 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 @@
// 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 @@
// 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...