[MIPS GlobalISel] VarArg argument lowering, select G_VASTART and vacopy
authorPetar Avramovic <Petar.Avramovic@rt-rk.com>
Mon, 23 Sep 2019 08:11:41 +0000 (08:11 +0000)
committerPetar Avramovic <Petar.Avramovic@rt-rk.com>
Mon, 23 Sep 2019 08:11:41 +0000 (08:11 +0000)
commitc063b0b0d3346d2a50e2ef28ec0147d6d53f399d
tree2a4206617dc800788ca4c826037ce7a2e8a0b9e4
parent0e490ae0a93c8b6ec48366ac7d46da442542b902
[MIPS GlobalISel] VarArg argument lowering, select G_VASTART and vacopy

CC_Mips doesn't accept vararg functions for O32, so we have to explicitly
use CC_Mips_FixedArg.
For lowerCall we now properly figure out whether callee function is vararg
or not, this has no effect for O32 since we always use CC_Mips_FixedArg.
For lower formal arguments we need to copy arguments in register to stack
and save pointer to start for argument list into MipsMachineFunction
object so that G_VASTART could use it during instruction select.
For vacopy we need to copy content from one vreg to another,
load and store are used for that purpose.

Differential Revision: https://reviews.llvm.org/D67756

llvm-svn: 372555
llvm/lib/Target/Mips/MipsCallLowering.cpp
llvm/lib/Target/Mips/MipsISelLowering.cpp
llvm/lib/Target/Mips/MipsInstructionSelector.cpp
llvm/lib/Target/Mips/MipsLegalizerInfo.cpp
llvm/lib/Target/Mips/MipsRegisterBankInfo.cpp
llvm/test/CodeGen/Mips/GlobalISel/instruction-select/var_arg.mir [new file with mode: 0644]
llvm/test/CodeGen/Mips/GlobalISel/irtranslator/var_arg.ll [new file with mode: 0644]
llvm/test/CodeGen/Mips/GlobalISel/legalizer/var_arg.mir [new file with mode: 0644]
llvm/test/CodeGen/Mips/GlobalISel/llvm-ir/var_arg.ll [new file with mode: 0644]
llvm/test/CodeGen/Mips/GlobalISel/regbankselect/var_arg.mir [new file with mode: 0644]