[llvm-commits] [llvm-gcc-4.2] r97989 - /llvm-gcc-4.2/trunk/gcc/llvm-types.cpp

Dan Gohman gohman at apple.com
Mon Mar 8 13:33:02 PST 2010


Author: djg
Date: Mon Mar  8 15:33:02 2010
New Revision: 97989

URL: http://llvm.org/viewvc/llvm-project?rev=97989&view=rev
Log:
ABIs don't support noalias on sret arguments. See PR6525 for details.

Modified:
    llvm-gcc-4.2/trunk/gcc/llvm-types.cpp

Modified: llvm-gcc-4.2/trunk/gcc/llvm-types.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-types.cpp?rev=97989&r1=97988&r2=97989&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-types.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-types.cpp Mon Mar  8 15:33:02 2010
@@ -1098,10 +1098,16 @@
     Attrs.push_back(AttributeWithIndex::get(0, RAttributes));
 
   // If this function returns via a shadow argument, the dest loc is passed
-  // in as a pointer.  Mark that pointer as struct-ret and noalias.
+  // in as a pointer.  Mark that pointer as struct-ret.
+  //
+  // It's tempting to want NoAlias here too, however even though llvm-gcc
+  // itself currently always passes a dedicated alloca as the actual argument,
+  // this isn't mandated by the ABI. There are other compilers which don't
+  // always pass a dedicated alloca. Using NoAlias here would make code which
+  // isn't interoperable with that of other compilers.
   if (ABIConverter.isShadowReturn())
     Attrs.push_back(AttributeWithIndex::get(ArgTys.size(),
-                                    Attribute::StructRet | Attribute::NoAlias));
+                                    Attribute::StructRet));
 
   std::vector<const Type*> ScalarArgs;
   if (static_chain) {





More information about the llvm-commits mailing list