Author: resistor Date: Mon Feb 18 03:32:29 2008 New Revision: 47266 URL: http://llvm.org/viewvc/llvm-project?rev=47266&view=rev Log: llvm-gcc ensures (by inserting extra alloca's and memcpy's) that all sret parameters are noalias as well. By properly marking this as such, we can enable sret return slot optimization in GVN.
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=47266&r1=47265&r2=47266&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/llvm-types.cpp (original) +++ llvm-gcc-4.2/trunk/gcc/llvm-types.cpp Mon Feb 18 03:32:29 2008 @@ -1054,10 +1054,11 @@ Attrs.push_back(ParamAttrsWithIndex::get(0, RAttributes)); // If this is a struct-return function, the dest loc is passed in as a - // pointer. Mark that pointer as structret. + // pointer. Mark that pointer as structret and noalias. if (ABIConverter.isStructReturn()) Attrs.push_back(ParamAttrsWithIndex::get(ArgTys.size(), - ParamAttr::StructRet)); + ParamAttr::StructRet | ParamAttr::NoAlias)); + if (static_chain) { // Pass the static chain as the first parameter. ABIConverter.HandleArgument(TREE_TYPE(static_chain)); @@ -1152,10 +1153,10 @@ Attrs.push_back(ParamAttrsWithIndex::get(0, RAttributes)); // If this is a struct-return function, the dest loc is passed in as a - // pointer. Mark that pointer as structret. + // pointer. Mark that pointer as structret, and noalias. if (ABIConverter.isStructReturn()) Attrs.push_back(ParamAttrsWithIndex::get(ArgTypes.size(), - ParamAttr::StructRet)); + ParamAttr::StructRet | ParamAttr::NoAlias)); if (static_chain) { // Pass the static chain as the first parameter. _______________________________________________ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits