[llvm-commits] [llvm] r143743 - /llvm/trunk/lib/Target/ARM/ARMFastISel.cpp

Chad Rosier mcrosier at apple.com
Fri Nov 4 16:09:49 PDT 2011


Author: mcrosier
Date: Fri Nov  4 18:09:49 2011
New Revision: 143743

URL: http://llvm.org/viewvc/llvm-project?rev=143743&view=rev
Log:
When materializing an i32, SExt vs ZExt doesn't matter when we're trying to fit
in a 16-bit immediate.  However, for the shorter non-legal types (i.e., i1, i8,
i16) we should not sign-extend.  This prevents us from materializing things
such as 'true' (i.e., i1 1).

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

Modified: llvm/trunk/lib/Target/ARM/ARMFastISel.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMFastISel.cpp?rev=143743&r1=143742&r2=143743&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMFastISel.cpp (original)
+++ llvm/trunk/lib/Target/ARM/ARMFastISel.cpp Fri Nov  4 18:09:49 2011
@@ -551,7 +551,7 @@
   // If we can do this in a single instruction without a constant pool entry
   // do so now.
   const ConstantInt *CI = cast<ConstantInt>(C);
-  if (Subtarget->hasV6T2Ops() && isUInt<16>(CI->getSExtValue())) {
+  if (Subtarget->hasV6T2Ops() && isUInt<16>(CI->getZExtValue())) {
     unsigned Opc = isThumb ? ARM::t2MOVi16 : ARM::MOVi16;
     unsigned ImmReg = createResultReg(TLI.getRegClassFor(VT));
     AddOptionalDefs(BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL,





More information about the llvm-commits mailing list