[llvm] r250938 - Drop assert that a call with struct return goes to a function with sret
Joerg Sonnenberger via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 21 13:05:01 PDT 2015
Author: joerg
Date: Wed Oct 21 15:05:01 2015
New Revision: 250938
URL: http://llvm.org/viewvc/llvm-project?rev=250938&view=rev
Log:
Drop assert that a call with struct return goes to a function with sret
attribute. Clang incorrectly misses it on __muldc3 and friends and the
type system doesn't include it properly either.
Added:
llvm/trunk/test/CodeGen/SPARC/missing-sret.ll
Modified:
llvm/trunk/lib/Target/Sparc/SparcISelLowering.cpp
Modified: llvm/trunk/lib/Target/Sparc/SparcISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Sparc/SparcISelLowering.cpp?rev=250938&r1=250937&r2=250938&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Sparc/SparcISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/Sparc/SparcISelLowering.cpp Wed Oct 21 15:05:01 2015
@@ -1040,8 +1040,8 @@ SparcTargetLowering::getSRetArgSize(Sele
if (!CalleeFn)
return 0;
- assert(CalleeFn->hasStructRetAttr() &&
- "Callee does not have the StructRet attribute.");
+ // It would be nice to check for the sret attribute on CalleeFn here,
+ // but since it is not part of the function type, any check will misfire.
PointerType *Ty = cast<PointerType>(CalleeFn->arg_begin()->getType());
Type *ElementTy = Ty->getElementType();
Added: llvm/trunk/test/CodeGen/SPARC/missing-sret.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/SPARC/missing-sret.ll?rev=250938&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/SPARC/missing-sret.ll (added)
+++ llvm/trunk/test/CodeGen/SPARC/missing-sret.ll Wed Oct 21 15:05:01 2015
@@ -0,0 +1,9 @@
+; RUN: llc -march=sparc -filetype=obj < %s > /dev/null 2> %t2
+
+define void @mul_double_cc({ double, double }* noalias sret %agg.result, double %a, double %b, double %c, double %d) {
+entry:
+ call void @__muldc3({ double, double }* sret %agg.result, double %a, double %b, double %c, double %d)
+ ret void
+}
+
+declare void @__muldc3({ double, double }*, double, double, double, double)
More information about the llvm-commits
mailing list