diff options
| author | Dan Gohman <gohman@apple.com> | 2009-07-20 17:43:30 +0000 |
|---|---|---|
| committer | Dan Gohman <gohman@apple.com> | 2009-07-20 17:43:30 +0000 |
| commit | 33a3fd0b9c76d85c478de582d6a26d79c8ddefbb (patch) | |
| tree | 55c923200c556084716a302394241343e81c9ed6 /llvm/lib/VMCore/Constants.cpp | |
| parent | 4041dfc360403ede97e0949ddc19a453b2bf6b27 (diff) | |
| download | bcm5719-llvm-33a3fd0b9c76d85c478de582d6a26d79c8ddefbb.tar.gz bcm5719-llvm-33a3fd0b9c76d85c478de582d6a26d79c8ddefbb.zip | |
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
Diffstat (limited to 'llvm/lib/VMCore/Constants.cpp')
| -rw-r--r-- | llvm/lib/VMCore/Constants.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/llvm/lib/VMCore/Constants.cpp b/llvm/lib/VMCore/Constants.cpp index f6d8e86850f..71e98377738 100644 --- a/llvm/lib/VMCore/Constants.cpp +++ b/llvm/lib/VMCore/Constants.cpp @@ -475,11 +475,8 @@ public: 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); |

