[llvm-commits] [llvm] r173276 - /llvm/trunk/lib/Transforms/InstCombine/InstructionCombining.cpp

Benjamin Kramer benny.kra at googlemail.com
Wed Jan 23 09:16:22 PST 2013


Author: d0k
Date: Wed Jan 23 11:16:22 2013
New Revision: 173276

URL: http://llvm.org/viewvc/llvm-project?rev=173276&view=rev
Log:
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.

Modified:
    llvm/trunk/lib/Transforms/InstCombine/InstructionCombining.cpp

Modified: llvm/trunk/lib/Transforms/InstCombine/InstructionCombining.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/InstCombine/InstructionCombining.cpp?rev=173276&r1=173275&r2=173276&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/InstCombine/InstructionCombining.cpp (original)
+++ llvm/trunk/lib/Transforms/InstCombine/InstructionCombining.cpp Wed Jan 23 11:16:22 2013
@@ -758,12 +758,7 @@
     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");
   }
 





More information about the llvm-commits mailing list