summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorKenneth Uildriks <kennethuil@gmail.com>2009-11-07 02:11:54 +0000
committerKenneth Uildriks <kennethuil@gmail.com>2009-11-07 02:11:54 +0000
commitb4997aeab74934ffa6fc0409afc4d8704245e372 (patch)
treee577bb851ec980f3ba1bcc272bf753ce3976e4fb /include
parent3de23e6f6cf337451a0934159da494d645b93133 (diff)
downloadllvm-b4997aeab74934ffa6fc0409afc4d8704245e372.tar.gz
llvm-b4997aeab74934ffa6fc0409afc4d8704245e372.tar.bz2
llvm-b4997aeab74934ffa6fc0409afc4d8704245e372.tar.xz
Add code to check at SelectionDAGISel::LowerArguments time to see if return values can be lowered to registers. Coming soon, code to perform sret-demotion if return values cannot be lowered to registers
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86324 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/CodeGen/CallingConvLower.h7
-rw-r--r--include/llvm/Target/TargetLowering.h12
2 files changed, 19 insertions, 0 deletions
diff --git a/include/llvm/CodeGen/CallingConvLower.h b/include/llvm/CodeGen/CallingConvLower.h
index 5e730fc12c..45a2757d37 100644
--- a/include/llvm/CodeGen/CallingConvLower.h
+++ b/include/llvm/CodeGen/CallingConvLower.h
@@ -183,6 +183,13 @@ public:
void AnalyzeReturn(const SmallVectorImpl<ISD::OutputArg> &Outs,
CCAssignFn Fn);
+ /// CheckReturn - Analyze the return values of a function, returning
+ /// true if the return can be performed without sret-demotion, and
+ /// false otherwise.
+ bool CheckReturn(const SmallVectorImpl<EVT> &OutTys,
+ const SmallVectorImpl<ISD::ArgFlagsTy> &ArgsFlags,
+ CCAssignFn Fn);
+
/// AnalyzeCallOperands - Analyze the outgoing arguments to a call,
/// incorporating info about the passed values into this state.
void AnalyzeCallOperands(const SmallVectorImpl<ISD::OutputArg> &Outs,
diff --git a/include/llvm/Target/TargetLowering.h b/include/llvm/Target/TargetLowering.h
index 8bc39d0b2c..1526a0de0c 100644
--- a/include/llvm/Target/TargetLowering.h
+++ b/include/llvm/Target/TargetLowering.h
@@ -1167,6 +1167,18 @@ public:
return SDValue(); // this is here to silence compiler errors
}
+ /// CanLowerReturn - This hook should be implemented to check whether the
+ /// return values described by the Outs array can fit into the return
+ /// registers. If false is returned, an sret-demotion is performed.
+ ///
+ virtual bool CanLowerReturn(CallingConv::ID CallConv, bool isVarArg,
+ const SmallVectorImpl<EVT> &OutTys,
+ const SmallVectorImpl<ISD::ArgFlagsTy> &ArgsFlags,
+ SelectionDAG &DAG)
+ {
+ // Return true by default to get preexisting behavior.
+ return true;
+ }
/// LowerReturn - This hook must be implemented to lower outgoing
/// return values, described by the Outs array, into the specified
/// DAG. The implementation should return the resulting token chain