summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/X86/X86CallLowering.cpp
diff options
context:
space:
mode:
authorDiana Picus <diana.picus@linaro.org>2019-06-27 09:18:03 +0000
committerDiana Picus <diana.picus@linaro.org>2019-06-27 09:18:03 +0000
commit43fb5ae50c53101b00a1fc068f51709837c10f05 (patch)
tree596356076a76a6aae28388ba5c7612b1780a7cac /llvm/lib/Target/X86/X86CallLowering.cpp
parent8138996128cd17d78d9d3e6ef7b49987565cb310 (diff)
downloadbcm5719-llvm-43fb5ae50c53101b00a1fc068f51709837c10f05.tar.gz
bcm5719-llvm-43fb5ae50c53101b00a1fc068f51709837c10f05.zip
[GlobalISel] Accept multiple vregs for lowerCall's args
Change the interface of CallLowering::lowerCall to accept several virtual registers for each argument, 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/D63551 llvm-svn: 364512
Diffstat (limited to 'llvm/lib/Target/X86/X86CallLowering.cpp')
-rw-r--r--llvm/lib/Target/X86/X86CallLowering.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/Target/X86/X86CallLowering.cpp b/llvm/lib/Target/X86/X86CallLowering.cpp
index 3a980f40ab8..b16b3839c85 100644
--- a/llvm/lib/Target/X86/X86CallLowering.cpp
+++ b/llvm/lib/Target/X86/X86CallLowering.cpp
@@ -409,7 +409,9 @@ bool X86CallLowering::lowerCall(MachineIRBuilder &MIRBuilder,
if (OrigArg.Flags.isByVal())
return false;
- assert(OrigArg.Regs.size() == 1 && "Can't handle multple regs yet");
+ if (OrigArg.Regs.size() > 1)
+ return false;
+
if (!splitToValueTypes(OrigArg, SplitArgs, DL, MRI,
[&](ArrayRef<Register> Regs) {
MIRBuilder.buildUnmerge(Regs, OrigArg.Regs[0]);
OpenPOWER on IntegriCloud