From 33a3fd0b9c76d85c478de582d6a26d79c8ddefbb Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Mon, 20 Jul 2009 17:43:30 +0000 Subject: 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. llvm-svn: 76437 --- llvm/lib/Analysis/BasicAliasAnalysis.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'llvm/lib/Analysis/BasicAliasAnalysis.cpp') diff --git a/llvm/lib/Analysis/BasicAliasAnalysis.cpp b/llvm/lib/Analysis/BasicAliasAnalysis.cpp index dcb5903a14e..308c69a87ee 100644 --- a/llvm/lib/Analysis/BasicAliasAnalysis.cpp +++ b/llvm/lib/Analysis/BasicAliasAnalysis.cpp @@ -38,13 +38,8 @@ using namespace llvm; // Useful predicates //===----------------------------------------------------------------------===// -static const User *isGEP(const Value *V) { - if (const GEPOperator *GEP = dyn_cast(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(V); } static const Value *GetGEPOperands(const Value *V, -- cgit v1.2.3