summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoerg Sonnenberger <joerg@bec.de>2015-10-21 20:05:01 +0000
committerJoerg Sonnenberger <joerg@bec.de>2015-10-21 20:05:01 +0000
commit7212809abca81c749294ad190a9efa81e2a4ab54 (patch)
treeadecb91f752273df501705ce4eb9c1d70710a220
parent485ed3c64c80202d0276c37ab6121907ba6286ed (diff)
downloadbcm5719-llvm-7212809abca81c749294ad190a9efa81e2a4ab54.tar.gz
bcm5719-llvm-7212809abca81c749294ad190a9efa81e2a4ab54.zip
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. llvm-svn: 250938
-rw-r--r--llvm/lib/Target/Sparc/SparcISelLowering.cpp4
-rw-r--r--llvm/test/CodeGen/SPARC/missing-sret.ll9
2 files changed, 11 insertions, 2 deletions
diff --git a/llvm/lib/Target/Sparc/SparcISelLowering.cpp b/llvm/lib/Target/Sparc/SparcISelLowering.cpp
index 73730990125..d07d48669cc 100644
--- a/llvm/lib/Target/Sparc/SparcISelLowering.cpp
+++ b/llvm/lib/Target/Sparc/SparcISelLowering.cpp
@@ -1040,8 +1040,8 @@ SparcTargetLowering::getSRetArgSize(SelectionDAG &DAG, SDValue Callee) const
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();
diff --git a/llvm/test/CodeGen/SPARC/missing-sret.ll b/llvm/test/CodeGen/SPARC/missing-sret.ll
new file mode 100644
index 00000000000..683d840bd25
--- /dev/null
+++ b/llvm/test/CodeGen/SPARC/missing-sret.ll
@@ -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)
OpenPOWER on IntegriCloud