diff options
author | Diana Picus <diana.picus@linaro.org> | 2017-03-20 14:40:18 +0000 |
---|---|---|
committer | Diana Picus <diana.picus@linaro.org> | 2017-03-20 14:40:18 +0000 |
commit | d79253a9f7833c429fbb3920277e8f2a11f8e1a7 (patch) | |
tree | a8da86c583a9f1dfbe2d5e559a2c8fc0dfe15b80 /llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp | |
parent | 00b34996b49748045e2dd77e4f7ca60c258639e2 (diff) | |
download | bcm5719-llvm-d79253a9f7833c429fbb3920277e8f2a11f8e1a7.tar.gz bcm5719-llvm-d79253a9f7833c429fbb3920277e8f2a11f8e1a7.zip |
[GlobalISel] Use the correct calling conv for calls
This commit adds a parameter that lets us pass in the calling convention
of the call to CallLowering::lowerCall. This allows us to handle
situations where the calling convetion of the callee is different from
that of the caller.
Differential Revision: https://reviews.llvm.org/D31039
llvm-svn: 298254
Diffstat (limited to 'llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp')
-rw-r--r-- | llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp b/llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp index af4747f7f7f..e26473d9a0d 100644 --- a/llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp +++ b/llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp @@ -114,11 +114,12 @@ LegalizerHelper::libcall(MachineInstr &MI) { Type *Ty = Size == 64 ? Type::getDoubleTy(Ctx) : Type::getFloatTy(Ctx); auto &CLI = *MIRBuilder.getMF().getSubtarget().getCallLowering(); auto &TLI = *MIRBuilder.getMF().getSubtarget().getTargetLowering(); - const char *Name = TLI.getLibcallName(getRTLibDesc(MI.getOpcode(), Size)); + auto Libcall = getRTLibDesc(MI.getOpcode(), Size); + const char *Name = TLI.getLibcallName(Libcall); MIRBuilder.getMF().getFrameInfo().setHasCalls(true); CLI.lowerCall( - MIRBuilder, MachineOperand::CreateES(Name), - {MI.getOperand(0).getReg(), Ty}, + MIRBuilder, TLI.getLibcallCallingConv(Libcall), + MachineOperand::CreateES(Name), {MI.getOperand(0).getReg(), Ty}, {{MI.getOperand(1).getReg(), Ty}, {MI.getOperand(2).getReg(), Ty}}); MI.eraseFromParent(); return Legalized; |