[llvm] r319428 - [ARM GlobalISel] Bail out for byval

Diana Picus via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 30 04:23:44 PST 2017


Author: rovka
Date: Thu Nov 30 04:23:44 2017
New Revision: 319428

URL: http://llvm.org/viewvc/llvm-project?rev=319428&view=rev
Log:
[ARM GlobalISel] Bail out for byval

Fallback if we have a byval parameter or argument since we don't support
them yet.

Modified:
    llvm/trunk/lib/Target/ARM/ARMCallLowering.cpp
    llvm/trunk/test/CodeGen/ARM/GlobalISel/arm-unsupported.ll

Modified: llvm/trunk/lib/Target/ARM/ARMCallLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMCallLowering.cpp?rev=319428&r1=319427&r2=319428&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMCallLowering.cpp (original)
+++ llvm/trunk/lib/Target/ARM/ARMCallLowering.cpp Thu Nov 30 04:23:44 2017
@@ -434,9 +434,12 @@ bool ARMCallLowering::lowerFormalArgumen
   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(MachineI
     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);

Modified: llvm/trunk/test/CodeGen/ARM/GlobalISel/arm-unsupported.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/GlobalISel/arm-unsupported.ll?rev=319428&r1=319427&r2=319428&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/ARM/GlobalISel/arm-unsupported.ll (original)
+++ llvm/trunk/test/CodeGen/ARM/GlobalISel/arm-unsupported.ll Thu Nov 30 04:23:44 2017
@@ -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" }




More information about the llvm-commits mailing list