diff options
author | Dale Johannesen <dalej@apple.com> | 2008-09-25 20:47:45 +0000 |
---|---|---|
committer | Dale Johannesen <dalej@apple.com> | 2008-09-25 20:47:45 +0000 |
commit | c9c6da61ac027d9818652d417907f84398288b99 (patch) | |
tree | 47df050f4b38ba844ed9163b55ac45fbf4b71a67 /lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp | |
parent | 0c8927efed7576d8992c3950601fc19394603a75 (diff) |
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56619 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp')
-rw-r--r-- | lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp index b9f1aa4507..01f1f28b23 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp +++ b/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)); } } } |