summaryrefslogtreecommitdiff
path: root/lib/Transforms/InstCombine/InstructionCombining.cpp
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2013-01-23 17:16:22 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2013-01-23 17:16:22 +0000
commit9381dd1ac9ac8a4020cd0dd03323a26f1ae5587f (patch)
treec6abcc29d5a62af28608e2d5b7c7dbecb8294a99 /lib/Transforms/InstCombine/InstructionCombining.cpp
parente807d1ea1e05fea895ba90dd4da8c91026ba1f29 (diff)
downloadllvm-9381dd1ac9ac8a4020cd0dd03323a26f1ae5587f.tar.gz
llvm-9381dd1ac9ac8a4020cd0dd03323a26f1ae5587f.tar.bz2
llvm-9381dd1ac9ac8a4020cd0dd03323a26f1ae5587f.tar.xz
InstCombine: Clean up weird code that talks about a modulus that's long gone.
This does the right thing unless the multiplication overflows, but the old code didn't handle that case either. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173276 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/InstCombine/InstructionCombining.cpp')
-rw-r--r--lib/Transforms/InstCombine/InstructionCombining.cpp7
1 files changed, 1 insertions, 6 deletions
diff --git a/lib/Transforms/InstCombine/InstructionCombining.cpp b/lib/Transforms/InstCombine/InstructionCombining.cpp
index dc7fe5cf6b..e9e05ceb65 100644
--- a/lib/Transforms/InstCombine/InstructionCombining.cpp
+++ b/lib/Transforms/InstCombine/InstructionCombining.cpp
@@ -758,12 +758,7 @@ Type *InstCombiner::FindElementAtOffset(Type *Ty, int64_t Offset,
FirstIdx = Offset/TySize;
Offset -= FirstIdx*TySize;
- // Handle hosts where % returns negative instead of values [0..TySize).
- if (Offset < 0) {
- --FirstIdx;
- Offset += TySize;
- assert(Offset >= 0);
- }
+ assert(Offset >= 0 && "Offset should never be negative!");
assert((uint64_t)Offset < (uint64_t)TySize && "Out of range offset");
}