Revert the addition of hasNoPointerOverflow to GEPOperator.
Getelementptrs that are defined to wrap are virtually useless to
optimization, and getelementptrs that are undefined on any kind
of overflow are too restrictive -- it's difficult to ensure that
all intermediate addresses are within bounds. I'm going to take
a different approach.
Remove a few optimizations that depended on this flag.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76437 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Analysis/BasicAliasAnalysis.cpp b/lib/Analysis/BasicAliasAnalysis.cpp
index dcb5903..308c69a 100644
--- a/lib/Analysis/BasicAliasAnalysis.cpp
+++ b/lib/Analysis/BasicAliasAnalysis.cpp
@@ -38,13 +38,8 @@
// Useful predicates
//===----------------------------------------------------------------------===//
-static const User *isGEP(const Value *V) {
- if (const GEPOperator *GEP = dyn_cast<GEPOperator>(V))
- // For the purposes of BasicAliasAnalysis, if the GEP has overflow it
- // could do crazy things.
- if (GEP->hasNoPointerOverflow())
- return GEP;
- return 0;
+static const GEPOperator *isGEP(const Value *V) {
+ return dyn_cast<GEPOperator>(V);
}
static const Value *GetGEPOperands(const Value *V,