diff options
author | Jessica Paquette <jpaquette@apple.com> | 2019-09-12 22:10:36 +0000 |
---|---|---|
committer | Jessica Paquette <jpaquette@apple.com> | 2019-09-12 22:10:36 +0000 |
commit | a42070a6aa8f32165cdce3e1ff6304c3cd0b8ff6 (patch) | |
tree | 7fa33d8340bf5c635fe7c7fed6614cc1c0ce923f /llvm/lib/CodeGen/GlobalISel/CallLowering.cpp | |
parent | 36e04d14e9fa34b06ddbe4f565a5560cfa3d84d6 (diff) | |
download | bcm5719-llvm-a42070a6aa8f32165cdce3e1ff6304c3cd0b8ff6.tar.gz bcm5719-llvm-a42070a6aa8f32165cdce3e1ff6304c3cd0b8ff6.zip |
[AArch64][GlobalISel] Support sibling calls with outgoing arguments
This adds support for lowering sibling calls with outgoing arguments.
e.g
```
define void @foo(i32 %a)
```
Support is ported from AArch64ISelLowering's `isEligibleForTailCallOptimization`.
The only thing that is missing is a full port of
`TargetLowering::parametersInCSRMatch`. So, if we're using swiftself,
we'll never tail call.
- Rename `analyzeCallResult` to `analyzeArgInfo`, since the function is now used
for both outgoing and incoming arguments
- Teach `OutgoingArgHandler` about tail calls. Tail calls use frame indices for
stack arguments.
- Teach `lowerFormalArguments` to set the bytes in the caller's stack argument
area. This is used later to check if the tail call's parameters will fit on
the caller's stack.
- Add `areCalleeOutgoingArgsTailCallable` to perform the eligibility check on
the callee's outgoing arguments.
For testing:
- Update call-translator-tail-call to verify that we can now tail call with
outgoing arguments, use G_FRAME_INDEX for stack arguments, and respect the
size of the caller's stack
- Remove GISel-specific check lines from speculation-hardening.ll, since GISel
now tail calls like the other selectors
- Add a GISel test line to tailcall-string-rvo.ll since we can tail call in that
test now
- Add a GISel test line to tailcall_misched_graph.ll since we tail call there
now. Add specific check lines for GISel, since the debug output from the
machine-scheduler differs with GlobalISel. The dependency still holds, but
the output comes out in a different order.
Differential Revision: https://reviews.llvm.org/D67471
llvm-svn: 371780
Diffstat (limited to 'llvm/lib/CodeGen/GlobalISel/CallLowering.cpp')
-rw-r--r-- | llvm/lib/CodeGen/GlobalISel/CallLowering.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/GlobalISel/CallLowering.cpp b/llvm/lib/CodeGen/GlobalISel/CallLowering.cpp index ccbe56da04e..9280c9efc93 100644 --- a/llvm/lib/CodeGen/GlobalISel/CallLowering.cpp +++ b/llvm/lib/CodeGen/GlobalISel/CallLowering.cpp @@ -378,7 +378,7 @@ bool CallLowering::handleAssignments(CCState &CCInfo, return true; } -bool CallLowering::analyzeCallResult(CCState &CCState, +bool CallLowering::analyzeArgInfo(CCState &CCState, SmallVectorImpl<ArgInfo> &Args, CCAssignFn &Fn) const { for (unsigned i = 0, e = Args.size(); i < e; ++i) { @@ -407,12 +407,12 @@ bool CallLowering::resultsCompatible(CallLoweringInfo &Info, SmallVector<CCValAssign, 16> ArgLocs1; CCState CCInfo1(CalleeCC, false, MF, ArgLocs1, F.getContext()); - if (!analyzeCallResult(CCInfo1, InArgs, CalleeAssignFn)) + if (!analyzeArgInfo(CCInfo1, InArgs, CalleeAssignFn)) return false; SmallVector<CCValAssign, 16> ArgLocs2; CCState CCInfo2(CallerCC, false, MF, ArgLocs2, F.getContext()); - if (!analyzeCallResult(CCInfo2, InArgs, CallerAssignFn)) + if (!analyzeArgInfo(CCInfo2, InArgs, CallerAssignFn)) return false; // We need the argument locations to match up exactly. If there's more in |