[MIPS GlobalISel] Handle position independent code
commit3286a72c3a6f76206d6601e4bedacdf2a7ee9376
authorPetar Avramovic <Petar.Avramovic@rt-rk.com>
Fri, 31 May 2019 08:27:06 +0000 (31 08:27 +0000)
committerPetar Avramovic <Petar.Avramovic@rt-rk.com>
Fri, 31 May 2019 08:27:06 +0000 (31 08:27 +0000)
tree4c99ad1626e62dc62059052d0c275388ad2e50bf
parenta50b5bd079b8698a71c8ccace24b4e0d1957d126
[MIPS GlobalISel] Handle position independent code

Handle position independent code for MIPS32.
When callee is global address, lower call will emit callee
as G_GLOBAL_VALUE and add target flag if needed.
Support $gp in getRegBankFromRegClass().
Select G_GLOBAL_VALUE, specially handle case when
there are target flags attached by lowerCall.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@362210 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/Mips/MipsCallLowering.cpp
lib/Target/Mips/MipsInstructionSelector.cpp
lib/Target/Mips/MipsMachineFunction.cpp
lib/Target/Mips/MipsMachineFunction.h
lib/Target/Mips/MipsRegisterBankInfo.cpp
test/CodeGen/Mips/GlobalISel/instruction-select/gloal_address_pic.mir [new file with mode: 0644]
test/CodeGen/Mips/GlobalISel/irtranslator/global_address_pic.ll [new file with mode: 0644]
test/CodeGen/Mips/GlobalISel/llvm-ir/global_address_pic.ll [new file with mode: 0644]
test/CodeGen/Mips/GlobalISel/regbankselect/global_address_pic.mir [new file with mode: 0644]