[llvm-commits] [llvm-gcc-4.0] r43376 - /llvm-gcc-4.0/trunk/gcc/llvm-convert.cpp

Dale Johannesen dalej at apple.com
Thu Oct 25 19:43:15 PDT 2007


Author: johannes
Date: Thu Oct 25 21:43:15 2007
New Revision: 43376

URL: http://llvm.org/viewvc/llvm-project?rev=43376&view=rev
Log:
(inline asm) don't canonicalize single-hard-reg
constraints; they're already canonical.
gcc.apple/443946.c


Modified:
    llvm-gcc-4.0/trunk/gcc/llvm-convert.cpp

Modified: llvm-gcc-4.0/trunk/gcc/llvm-convert.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.0/trunk/gcc/llvm-convert.cpp?rev=43376&r1=43375&r2=43376&view=diff

==============================================================================
--- llvm-gcc-4.0/trunk/gcc/llvm-convert.cpp (original)
+++ llvm-gcc-4.0/trunk/gcc/llvm-convert.cpp Thu Oct 25 21:43:15 2007
@@ -3962,6 +3962,7 @@
     if (IsInOut)
       ++NumInOut, ++NumInputs;
 
+    std::string SimplifiedConstraint;
     // If this output register is pinned to a machine register, use that machine
     // register instead of the specified constraint.
     if (TREE_CODE(Operand) == VAR_DECL && DECL_HARD_REGISTER(Operand)) {
@@ -3975,14 +3976,14 @@
         memcpy(NewConstraint+2, reg_names[RegNum], RegNameLen);
         NewConstraint[RegNameLen+2] = '}';
         NewConstraint[RegNameLen+3] = 0;
-        Constraint = NewConstraint;
+        SimplifiedConstraint = NewConstraint;
       }
+    } else {
+      // If we can simplify the constraint into something else, do so now.  This
+      // avoids LLVM having to know about all the (redundant) GCC constraints.
+       SimplifiedConstraint = CanonicalizeConstraint(Constraint+1);
     }
     
-    // If we can simplify the constraint into something else, do so now.  This
-    // avoids LLVM having to know about all the (redundant) GCC constraints.
-    std::string SimplifiedConstraint = CanonicalizeConstraint(Constraint+1);
-    
     LValue Dest = EmitLV(Operand);
     const Type *DestValTy =
       cast<PointerType>(Dest.Ptr->getType())->getElementType();





More information about the llvm-commits mailing list