From: Igor Breger Date: Wed, 5 Jul 2017 11:40:35 +0000 (+0000) Subject: [GlobalISel][X86] For now don't handle not trivial function arguments lowering. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4ecd96466ec1d8d4c8e3405772de0e070613916f;p=llvm [GlobalISel][X86] For now don't handle not trivial function arguments lowering. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307142 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Target/X86/X86CallLowering.cpp b/lib/Target/X86/X86CallLowering.cpp index bb549dc0488..99aeec67c32 100644 --- a/lib/Target/X86/X86CallLowering.cpp +++ b/lib/Target/X86/X86CallLowering.cpp @@ -195,8 +195,18 @@ bool X86CallLowering::lowerFormalArguments(MachineIRBuilder &MIRBuilder, SmallVector SplitArgs; unsigned Idx = 0; for (auto &Arg : F.args()) { + + // TODO: handle not simple cases. + if (Arg.hasAttribute(Attribute::ByVal) || + Arg.hasAttribute(Attribute::InReg) || + Arg.hasAttribute(Attribute::StructRet) || + Arg.hasAttribute(Attribute::SwiftSelf) || + Arg.hasAttribute(Attribute::SwiftError) || + Arg.hasAttribute(Attribute::Nest)) + return false; + ArgInfo OrigArg(VRegs[Idx], Arg.getType()); - setArgFlags(OrigArg, Idx + 1, DL, F); + setArgFlags(OrigArg, Idx + AttributeList::FirstArgIndex, DL, F); if (!splitToValueTypes(OrigArg, SplitArgs, DL, MRI, [&](ArrayRef Regs) { MIRBuilder.buildMerge(VRegs[Idx], Regs);