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
diff --git a/llvm/lib/VMCore/Constants.cpp b/llvm/lib/VMCore/Constants.cpp
index f6d8e86..71e9837 100644
--- a/llvm/lib/VMCore/Constants.cpp
+++ b/llvm/lib/VMCore/Constants.cpp
@@ -475,11 +475,8 @@
static GetElementPtrConstantExpr *Create(Constant *C,
const std::vector<Constant*>&IdxList,
const Type *DestTy) {
- GetElementPtrConstantExpr *Result = new(IdxList.size() + 1)
- GetElementPtrConstantExpr(C, IdxList, DestTy);
- // Getelementptr defaults to having no pointer overflow.
- cast<GEPOperator>(Result)->setHasNoPointerOverflow(true);
- return Result;
+ return
+ new(IdxList.size() + 1) GetElementPtrConstantExpr(C, IdxList, DestTy);
}
/// Transparently provide more efficient getOperand methods.
DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value);