[llvm-commits] [llvm] r134247 - /llvm/trunk/lib/Target/ARM/Thumb2SizeReduction.cpp

Jim Grosbach grosbach at apple.com
Fri Jul 1 12:07:09 PDT 2011


Author: grosbach
Date: Fri Jul  1 14:07:09 2011
New Revision: 134247

URL: http://llvm.org/viewvc/llvm-project?rev=134247&view=rev
Log:
Fix off-by-one error.

(low two bits always zero, so off by one bit of encoded value).

Modified:
    llvm/trunk/lib/Target/ARM/Thumb2SizeReduction.cpp

Modified: llvm/trunk/lib/Target/ARM/Thumb2SizeReduction.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/Thumb2SizeReduction.cpp?rev=134247&r1=134246&r2=134247&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/Thumb2SizeReduction.cpp (original)
+++ llvm/trunk/lib/Target/ARM/Thumb2SizeReduction.cpp Fri Jul  1 14:07:09 2011
@@ -491,7 +491,7 @@
     // The immediate must be in range, the destination register must be a low
     // reg, the predicate must be "always" and the condition flags must not
     // be being set.
-    if (Imm & 3 || Imm > 1024)
+    if (Imm & 3 || Imm > 1020)
       return false;
     if (!isARMLowRegister(MI->getOperand(0).getReg()))
       return false;





More information about the llvm-commits mailing list