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/Analysis/ScalarEvolution.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/Analysis/ScalarEvolution.cpp')
-rw-r--r-- | llvm/lib/Analysis/ScalarEvolution.cpp | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/llvm/lib/Analysis/ScalarEvolution.cpp b/llvm/lib/Analysis/ScalarEvolution.cpp index 6c23f401c5b..aadba9d9d3d 100644 --- a/llvm/lib/Analysis/ScalarEvolution.cpp +++ b/llvm/lib/Analysis/ScalarEvolution.cpp @@ -2938,15 +2938,10 @@ const SCEV *ScalarEvolution::createSCEV(Value *V) { return getSCEV(U->getOperand(0)); break; - case Instruction::IntToPtr: - if (!TD) break; // Without TD we can't analyze pointers. - return getTruncateOrZeroExtend(getSCEV(U->getOperand(0)), - TD->getIntPtrType()); - - case Instruction::PtrToInt: - if (!TD) break; // Without TD we can't analyze pointers. - return getTruncateOrZeroExtend(getSCEV(U->getOperand(0)), - U->getType()); + // It's tempting to handle inttoptr and ptrtoint, however this can + // lead to pointer expressions which cannot be expanded to GEPs + // (because they may overflow). For now, the only pointer-typed + // expressions we handle are GEPs and address literals. case Instruction::GetElementPtr: if (!TD) break; // Without TD we can't analyze pointers. |