tidy up
authorChris Lattner <sabre@nondot.org>
Tue, 19 Apr 2011 05:15:59 +0000 (05:15 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 19 Apr 2011 05:15:59 +0000 (05:15 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129753 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/X86/X86FastISel.cpp

index 0be9dfa06c4469f427b16edbf456545ac1e74274..c563a56f985ed115f17d82c2812b58a52faa04db 100644 (file)
@@ -1535,11 +1535,12 @@ bool X86FastISel::X86SelectCall(const Instruction *I) {
     }
     
     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 @@ bool X86FastISel::X86SelectCall(const Instruction *I) {
                            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) ||