diff options
| author | Chris Lattner <sabre@nondot.org> | 2009-01-11 20:41:36 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2009-01-11 20:41:36 +0000 |
| commit | bd3c7c8b5218fad9bc97bc3d934d69ff8b04f2c7 (patch) | |
| tree | c27f5bf49c2bc3b380a78e0dcacd26f54f1596ac | |
| parent | b19151686f949398bfc8101572cbc697f2b55ff4 (diff) | |
| download | bcm5719-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.cpp | 2 |
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) { |

