summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp
diff options
context:
space:
mode:
authorDale Johannesen <dalej@apple.com>2008-09-25 20:47:45 +0000
committerDale Johannesen <dalej@apple.com>2008-09-25 20:47:45 +0000
commitc50ada2f5678d8745b115d9a5de51309094845f0 (patch)
tree666bcf7623da63d6001f0bb59643f4a3b30409ef /llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp
parent15146a56e1a1d7cd661c4a557e167627ec695696 (diff)
downloadbcm5719-llvm-c50ada2f5678d8745b115d9a5de51309094845f0.tar.gz
bcm5719-llvm-c50ada2f5678d8745b115d9a5de51309094845f0.zip
Accept 'inreg' attribute on x86 functions as
meaning sse_regparm (i.e. float/double values go in XMM0 instead of ST0). Update documentation to reflect reality. llvm-svn: 56619
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp
index b9f1aa45078..01f1f28b23e 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp
@@ -913,7 +913,8 @@ void SelectionDAGLowering::visitRet(ReturnInst &I) {
MVT VT = ValueVTs[j];
// FIXME: C calling convention requires the return type to be promoted to
- // at least 32-bit. But this is not necessary for non-C calling conventions.
+ // at least 32-bit. But this is not necessary for non-C calling
+ // conventions.
if (VT.isInteger()) {
MVT MinVT = TLI.getRegisterType(MVT::i32);
if (VT.bitsLT(MinVT))
@@ -934,9 +935,13 @@ void SelectionDAGLowering::visitRet(ReturnInst &I) {
getCopyToParts(DAG, SDValue(RetOp.getNode(), RetOp.getResNo() + j),
&Parts[0], NumParts, PartVT, ExtendKind);
+ // 'inreg' on function refers to return value
+ ISD::ArgFlagsTy Flags = ISD::ArgFlagsTy();
+ if (F->paramHasAttr(0, ParamAttr::InReg))
+ Flags.setInReg();
for (unsigned i = 0; i < NumParts; ++i) {
NewValues.push_back(Parts[i]);
- NewValues.push_back(DAG.getArgFlags(ISD::ArgFlagsTy()));
+ NewValues.push_back(DAG.getArgFlags(Flags));
}
}
}
OpenPOWER on IntegriCloud