summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/ARM/ARMCallLowering.cpp
diff options
context:
space:
mode:
authorDiana Picus <diana.picus@linaro.org>2019-06-27 09:15:53 +0000
committerDiana Picus <diana.picus@linaro.org>2019-06-27 09:15:53 +0000
commit8138996128cd17d78d9d3e6ef7b49987565cb310 (patch)
tree6940587d49fcb7f7116dfb017a531017ac5d514c /llvm/lib/Target/ARM/ARMCallLowering.cpp
parentc3dbe2397792302232114ebb15507c3977b605d2 (diff)
downloadbcm5719-llvm-8138996128cd17d78d9d3e6ef7b49987565cb310.tar.gz
bcm5719-llvm-8138996128cd17d78d9d3e6ef7b49987565cb310.zip
[GlobalISel] Accept multiple vregs for lowerCall's result
Change the interface of CallLowering::lowerCall to accept several virtual registers for the call result, instead of just one. This is a follow-up to D46018. CallLowering::lowerReturn was similarly refactored in D49660 and lowerFormalArguments in D63549. With this change, we no longer pack the virtual registers generated for aggregates into one big lump before delegating to the target. Therefore, the target can decide itself whether it wants to handle them as separate pieces or use one big register. ARM and AArch64 have been updated to use the passed in virtual registers directly, which means we no longer need to generate so many merge/extract instructions. NFCI for AMDGPU, Mips and X86. Differential Revision: https://reviews.llvm.org/D63550 llvm-svn: 364511
Diffstat (limited to 'llvm/lib/Target/ARM/ARMCallLowering.cpp')
-rw-r--r--llvm/lib/Target/ARM/ARMCallLowering.cpp13
1 files changed, 3 insertions, 10 deletions
diff --git a/llvm/lib/Target/ARM/ARMCallLowering.cpp b/llvm/lib/Target/ARM/ARMCallLowering.cpp
index ea5bfb595a9..71b92517620 100644
--- a/llvm/lib/Target/ARM/ARMCallLowering.cpp
+++ b/llvm/lib/Target/ARM/ARMCallLowering.cpp
@@ -619,21 +619,14 @@ bool ARMCallLowering::lowerCall(MachineIRBuilder &MIRBuilder,
return false;
ArgInfos.clear();
- SmallVector<Register, 8> SplitRegs;
- splitToValueTypes(OrigRet, ArgInfos, MF,
- [&](Register Reg) { SplitRegs.push_back(Reg); });
+ splitToValueTypes(OrigRet, ArgInfos, MF, [&](Register Reg) {
+ llvm_unreachable("Call results should already be split");
+ });
auto RetAssignFn = TLI.CCAssignFnForReturn(CallConv, IsVarArg);
CallReturnHandler RetHandler(MIRBuilder, MRI, MIB, RetAssignFn);
if (!handleAssignments(MIRBuilder, ArgInfos, RetHandler))
return false;
-
- if (!SplitRegs.empty()) {
- // We have split the value and allocated each individual piece, now build
- // it up again.
- assert(OrigRet.Regs.size() == 1 && "Can't handle multple regs yet");
- MIRBuilder.buildMerge(OrigRet.Regs[0], SplitRegs);
- }
}
// We now know the size of the stack - update the ADJCALLSTACKDOWN
OpenPOWER on IntegriCloud