summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-01-11 20:41:36 +0000
committerChris Lattner <sabre@nondot.org>2009-01-11 20:41:36 +0000
commitbd3c7c8b5218fad9bc97bc3d934d69ff8b04f2c7 (patch)
treec27f5bf49c2bc3b380a78e0dcacd26f54f1596ac
parentb19151686f949398bfc8101572cbc697f2b55ff4 (diff)
downloadbcm5719-llvm-bd3c7c8b5218fad9bc97bc3d934d69ff8b04f2c7.tar.gz
bcm5719-llvm-bd3c7c8b5218fad9bc97bc3d934d69ff8b04f2c7.zip
Duncan is nervous about undefinedness of % with negatives. I'm
not thrilled about 64-bit % in general, so rewrite to use * instead. llvm-svn: 62047
-rw-r--r--llvm/lib/Transforms/Scalar/InstructionCombining.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp
index b6604a930d6..49215317e26 100644
--- a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp
+++ b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp
@@ -7710,7 +7710,7 @@ static bool FindElementAtOffset(const Type *Ty, int64_t Offset,
int64_t FirstIdx = 0;
if (int64_t TySize = TD->getABITypeSize(Ty)) {
FirstIdx = Offset/TySize;
- Offset %= TySize;
+ Offset -= FirstIdx*TySize;
// Handle hosts where % returns negative instead of values [0..TySize).
if (Offset < 0) {
OpenPOWER on IntegriCloud