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
This commit is contained in:
Dan Gohman
2009-07-20 17:43:30 +00:00
parent 8f4e22ff9a
commit f241174421
12 changed files with 43 additions and 266 deletions
+2 -7
View File
@@ -38,13 +38,8 @@ using namespace llvm;
// 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,