1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 11:13:28 +01:00

[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
This commit is contained in:
Diana Picus 2017-11-30 12:23:44 +00:00
parent 86edc13433
commit 8e5e54ba29
2 changed files with 22 additions and 1 deletions

View File

@ -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);

View File

@ -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" }