[llvm-commits] [llvm] r56082 - /llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp

Dan Gohman gohman at apple.com
Wed Sep 10 17:25:00 PDT 2008


Author: djg
Date: Wed Sep 10 19:25:00 2008
New Revision: 56082

URL: http://llvm.org/viewvc/llvm-project?rev=56082&view=rev
Log:
In my analysis for r56076 I missed the case where the original
multiplication overflows.

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

Modified: llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp?rev=56082&r1=56081&r2=56082&view=diff

==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp Wed Sep 10 19:25:00 2008
@@ -5789,7 +5789,8 @@
       // e.g. X/-5 op -3  --> [15, 20)
       LoBound = Prod;
       LoOverflow = HiOverflow = ProdOV ? 1 : 0;
-      HiOverflow = SubWithOverflow(HiBound, Prod, DivRHS, true);
+      if (!HiOverflow)
+        HiOverflow = SubWithOverflow(HiBound, Prod, DivRHS, true);
     }
     
     // Dividing by a negative swaps the condition.  LT <-> GT





More information about the llvm-commits mailing list