[llvm-commits] [llvm] r129753 - /llvm/trunk/lib/Target/X86/X86FastISel.cpp

Chris Lattner sabre at nondot.org
Mon Apr 18 22:15:59 PDT 2011


Author: lattner
Date: Tue Apr 19 00:15:59 2011
New Revision: 129753

URL: http://llvm.org/viewvc/llvm-project?rev=129753&view=rev
Log:
tidy up

Modified:
    llvm/trunk/lib/Target/X86/X86FastISel.cpp

Modified: llvm/trunk/lib/Target/X86/X86FastISel.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86FastISel.cpp?rev=129753&r1=129752&r2=129753&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86FastISel.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86FastISel.cpp Tue Apr 19 00:15:59 2011
@@ -1535,11 +1535,12 @@
     }
     
     unsigned ArgReg;
+    
+    // Passing bools around ends up doing a trunc to i1 and passing it.
+    // Codegen this as an argument + "and 1".
     if (ArgVal->getType()->isIntegerTy(1) && isa<TruncInst>(ArgVal) &&
         cast<TruncInst>(ArgVal)->getParent() == I->getParent() &&
         ArgVal->hasOneUse()) {
-      // Passing bools around ends up doing a trunc to i1 and passing it.
-      // Codegen this as an argument + "and 1".
       ArgVal = cast<TruncInst>(ArgVal)->getOperand(0);
       ArgReg = getRegForValue(ArgVal);
       if (ArgReg == 0) return false;
@@ -1551,9 +1552,10 @@
                            ArgVal->hasOneUse(), 1);
     } else {
       ArgReg = getRegForValue(ArgVal);
-      if (ArgReg == 0) return false;
     }
 
+    if (ArgReg == 0) return false;
+
     // FIXME: Only handle *easy* calls for now.
     if (CS.paramHasAttr(AttrInd, Attribute::InReg) ||
         CS.paramHasAttr(AttrInd, Attribute::StructRet) ||





More information about the llvm-commits mailing list