summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
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
commitcd86115d8a94e1a0c1ad93cd60963524fa297c96 (patch)
tree1ab420fa525c54f74f864e495dcfb74ee636669c /llvm/lib/Transforms
parentf759526983b4f627c389af77bf69fb9d198ed26f (diff)
downloadbcm5719-llvm-cd86115d8a94e1a0c1ad93cd60963524fa297c96.tar.gz
bcm5719-llvm-cd86115d8a94e1a0c1ad93cd60963524fa297c96.zip
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. llvm-svn: 173276
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/InstCombine/InstructionCombining.cpp7
1 files changed, 1 insertions, 6 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp b/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
index dc7fe5cf6b5..e9e05ceb658 100644
--- a/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
+++ b/llvm/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");
}
OpenPOWER on IntegriCloud