diff options
author | Diana Picus <diana.picus@linaro.org> | 2017-11-30 12:23:44 +0000 |
---|---|---|
committer | Diana Picus <diana.picus@linaro.org> | 2017-11-30 12:23:44 +0000 |
commit | f003d9ff95eecb2cd84b8c46f1ad9485a597c161 (patch) | |
tree | 2487f57701115365d1755e60a2d526362772d33c | |
parent | 93ef145862e140ed880fd2eca404dc2641a12093 (diff) | |
download | bcm5719-llvm-f003d9ff95eecb2cd84b8c46f1ad9485a597c161.tar.gz bcm5719-llvm-f003d9ff95eecb2cd84b8c46f1ad9485a597c161.zip |
[ARM GlobalISel] Bail out for byval
Fallback if we have a byval parameter or argument since we don't support
them yet.
llvm-svn: 319428
-rw-r--r-- | llvm/lib/Target/ARM/ARMCallLowering.cpp | 8 | ||||
-rw-r--r-- | llvm/test/CodeGen/ARM/GlobalISel/arm-unsupported.ll | 15 |
2 files changed, 22 insertions, 1 deletions
diff --git a/llvm/lib/Target/ARM/ARMCallLowering.cpp b/llvm/lib/Target/ARM/ARMCallLowering.cpp index 1c2df39d05a..7338ac8bcb5 100644 --- a/llvm/lib/Target/ARM/ARMCallLowering.cpp +++ b/llvm/lib/Target/ARM/ARMCallLowering.cpp @@ -434,9 +434,12 @@ bool ARMCallLowering::lowerFormalArguments(MachineIRBuilder &MIRBuilder, auto &MBB = MIRBuilder.getMBB(); auto DL = MF.getDataLayout(); - for (auto &Arg : F.args()) + for (auto &Arg : F.args()) { if (!isSupportedType(DL, TLI, Arg.getType())) return false; + if (Arg.hasByValOrInAllocaAttr()) + return false; + } CCAssignFn *AssignFn = TLI.CCAssignFnForCall(F.getCallingConv(), F.isVarArg()); @@ -529,6 +532,9 @@ bool ARMCallLowering::lowerCall(MachineIRBuilder &MIRBuilder, if (!Arg.IsFixed) return false; + if (Arg.Flags.isByVal()) + return false; + SmallVector<unsigned, 8> Regs; splitToValueTypes(Arg, ArgInfos, MF, [&](unsigned Reg, uint64_t Offset) { Regs.push_back(Reg); diff --git a/llvm/test/CodeGen/ARM/GlobalISel/arm-unsupported.ll b/llvm/test/CodeGen/ARM/GlobalISel/arm-unsupported.ll index bdba5356390..f9d41d9a38f 100644 --- a/llvm/test/CodeGen/ARM/GlobalISel/arm-unsupported.ll +++ b/llvm/test/CodeGen/ARM/GlobalISel/arm-unsupported.ll @@ -113,4 +113,19 @@ define i32 @test_thread_local_global() { ret i32 %v } +%byval.class = type { i32 } + +define void @test_byval_arg(%byval.class* byval %x) { +; CHECK: remark: {{.*}} unable to lower arguments: void (%byval.class*)* +; CHECK-LABEL: warning: Instruction selection used fallback path for test_byval + ret void +} + +define void @test_byval_param(%byval.class* %x) { +; CHECK: remark: {{.*}} unable to translate instruction: call +; CHECK-LABEL: warning: Instruction selection used fallback path for test_byval_param + call void @test_byval_arg(%byval.class* byval %x) + ret void +} + attributes #0 = { "target-features"="+thumb-mode" } |