[llvm] r311321 - [GlobalISel][X86] LowerCall, for now don't handel ByValue function arguments.
Igor Breger via llvm-commits
llvm-commits at lists.llvm.org
Mon Aug 21 01:59:59 PDT 2017
Author: ibreger
Date: Mon Aug 21 01:59:59 2017
New Revision: 311321
URL: http://llvm.org/viewvc/llvm-project?rev=311321&view=rev
Log:
[GlobalISel][X86] LowerCall, for now don't handel ByValue function arguments.
Modified:
llvm/trunk/lib/Target/X86/X86CallLowering.cpp
llvm/trunk/test/CodeGen/X86/GlobalISel/x86_64-fallback.ll
Modified: llvm/trunk/lib/Target/X86/X86CallLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86CallLowering.cpp?rev=311321&r1=311320&r2=311321&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86CallLowering.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86CallLowering.cpp Mon Aug 21 01:59:59 2017
@@ -322,6 +322,11 @@ bool X86CallLowering::lowerCall(MachineI
SmallVector<ArgInfo, 8> SplitArgs;
for (const auto &OrigArg : OrigArgs) {
+
+ // TODO: handle not simple cases.
+ if (OrigArg.Flags.isByVal())
+ return false;
+
if (!splitToValueTypes(OrigArg, SplitArgs, DL, MRI,
[&](ArrayRef<unsigned> Regs) {
MIRBuilder.buildUnmerge(Regs, OrigArg.Reg);
Modified: llvm/trunk/test/CodeGen/X86/GlobalISel/x86_64-fallback.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/GlobalISel/x86_64-fallback.ll?rev=311321&r1=311320&r2=311321&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/GlobalISel/x86_64-fallback.ll (original)
+++ llvm/trunk/test/CodeGen/X86/GlobalISel/x86_64-fallback.ll Mon Aug 21 01:59:59 2017
@@ -16,3 +16,14 @@ define void @test_x86_fp80_dump(x86_fp80
ret void
}
+; Check that we fallback on byVal argument
+; FALLBACK-WITH-REPORT-ERR: remark: <unknown>:0:0: unable to translate instruction: call: ' call void @ScaleObjectOverwrite_3(%struct.PointListStruct* %index, %struct.PointListStruct* byval %index)' (in function: ScaleObjectOverwrite_2)
+; FALLBACK-WITH-REPORT-ERR: warning: Instruction selection used fallback path for ScaleObjectOverwrite_2
+; FALLBACK-WITH-REPORT-OUT-LABEL: ScaleObjectOverwrite_2:
+%struct.PointListStruct = type { i8*, i8* }
+declare void @ScaleObjectOverwrite_3(%struct.PointListStruct* %index, %struct.PointListStruct* byval %index2)
+define void @ScaleObjectOverwrite_2(%struct.PointListStruct* %index) {
+entry:
+ call void @ScaleObjectOverwrite_3(%struct.PointListStruct* %index, %struct.PointListStruct* byval %index)
+ ret void
+}
More information about the llvm-commits
mailing list