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());
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);
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" }