[llvm-commits] [llvm-gcc-4.2] r52240 - in /llvm-gcc-4.2/trunk/gcc: config/i386/llvm-i386.cpp llvm-abi.h

Dale Johannesen dalej at apple.com
Thu Jun 12 11:47:31 PDT 2008


Author: johannes
Date: Thu Jun 12 13:47:31 2008
New Revision: 52240

URL: http://llvm.org/viewvc/llvm-project?rev=52240&view=rev
Log:
X86-64 ABI.  Removed comment:
"llvm only accepts first class types for multiple values in ret instruction"
and the code that checks this; in fact, llvm_x86_64_get_multiple_return_reg_classes
reduces aggregates to first class types, so this check is not needed.
All struct-layout-1 C tests now pass comparing llvm-gcc to gcc-4.2.


Modified:
    llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.cpp
    llvm-gcc-4.2/trunk/gcc/llvm-abi.h

Modified: llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.cpp?rev=52240&r1=52239&r2=52240&view=diff

==============================================================================
--- llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.cpp Thu Jun 12 13:47:31 2008
@@ -941,15 +941,13 @@
   if (llvm_x86_should_not_return_complex_in_memory(TreeType))
     return true;
 
-  // llvm only accepts first class types for multiple values in ret instruction.
+  // FIXME: llvm x86-64 code generator is not able to handle return {i8, float}
   bool foundInt = false;
   unsigned STyElements = STy->getNumElements();
   for (unsigned i = 0; i < STyElements; ++i) { 
     const Type *ETy = STy->getElementType(i);
     if (const ArrayType *ATy = dyn_cast<ArrayType>(ETy))
       ETy = ATy->getElementType();
-    if (!ETy->isSingleValueType() && ETy->getTypeID() != Type::X86_FP80TyID)
-      return false;
     if (ETy->isInteger())
       foundInt = true;
   }
@@ -961,7 +959,6 @@
   if (NumClasses == 0)
     return false;
 
-  // FIXME: llvm x86-64 code generator is not able to handle return {i8, float}
   if (NumClasses == 1 && foundInt)
     return false;
 

Modified: llvm-gcc-4.2/trunk/gcc/llvm-abi.h
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-abi.h?rev=52240&r1=52239&r2=52240&view=diff

==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-abi.h (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-abi.h Thu Jun 12 13:47:31 2008
@@ -376,10 +376,10 @@
       } else {
         // Otherwise return as an integer value large enough to hold the entire
         // aggregate.
-        if (const Type* ScalarTy = LLVM_SCALAR_TYPE_FOR_STRUCT_RETURN(type))
-          C.HandleAggregateResultAsScalar(ScalarTy);
-        else if (const Type *AggrTy = LLVM_AGGR_TYPE_FOR_STRUCT_RETURN(type))
+        if (const Type *AggrTy = LLVM_AGGR_TYPE_FOR_STRUCT_RETURN(type))
           C.HandleAggregateResultAsAggregate(AggrTy);
+        else if (const Type* ScalarTy = LLVM_SCALAR_TYPE_FOR_STRUCT_RETURN(type))
+          C.HandleAggregateResultAsScalar(ScalarTy);
         else {
           assert(0 && "Unable to determine how to return this aggregate!");
           abort();





More information about the llvm-commits mailing list