OSDN Git Service

[MIPS GlobalISel] RegBankSelect for chains of ambiguous instructions
authorPetar Avramovic <Petar.Avramovic@rt-rk.com>
Thu, 11 Jul 2019 09:22:49 +0000 (09:22 +0000)
committerPetar Avramovic <Petar.Avramovic@rt-rk.com>
Thu, 11 Jul 2019 09:22:49 +0000 (09:22 +0000)
commit2509fcf57e63bb16b000618b65e9b25b95c5b5cd
treea29c55b61c8e9f8dfcba2b796ca269131cc768b1
parent2c80014379907e9d8e61683488dce4d5f4c804c8
[MIPS GlobalISel] RegBankSelect for chains of ambiguous instructions

When one of the uses/defs of ambiguous instruction is also ambiguous
visit it recursively and search its uses/defs for instruction with
only one mapping available.
When all instruction in a chain are ambiguous arbitrary mapping can
be selected. For s64 operands in ambiguous chain fprb is selected since
it results in less instructions then having to narrow scalar s64 to s32.
For s32 both gprb and fprb result in same number of instructions and
gprb is selected like a general purpose option.

At the moment we always avoid cross register bank copies.
TODO: Implement a model for costs calculations of different mappings
on same instruction and cross bank copies. Allow cross bank copies
when appropriate according to cost model.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365743 91177308-0d34-0410-b5e6-96231b3b80d8
14 files changed:
lib/Target/Mips/MipsRegisterBankInfo.cpp
lib/Target/Mips/MipsRegisterBankInfo.h
test/CodeGen/Mips/GlobalISel/llvm-ir/load.ll
test/CodeGen/Mips/GlobalISel/llvm-ir/long_ambiguous_chain_s32.ll [new file with mode: 0644]
test/CodeGen/Mips/GlobalISel/llvm-ir/long_ambiguous_chain_s64.ll [new file with mode: 0644]
test/CodeGen/Mips/GlobalISel/llvm-ir/phi.ll
test/CodeGen/Mips/GlobalISel/llvm-ir/select.ll
test/CodeGen/Mips/GlobalISel/llvm-ir/test_TypeInfoforMF.ll [new file with mode: 0644]
test/CodeGen/Mips/GlobalISel/regbankselect/load.mir
test/CodeGen/Mips/GlobalISel/regbankselect/long_ambiguous_chain_s32.mir [new file with mode: 0644]
test/CodeGen/Mips/GlobalISel/regbankselect/long_ambiguous_chain_s64.mir [new file with mode: 0644]
test/CodeGen/Mips/GlobalISel/regbankselect/phi.mir
test/CodeGen/Mips/GlobalISel/regbankselect/select.mir
test/CodeGen/Mips/GlobalISel/regbankselect/test_TypeInfoforMF.mir [new file with mode: 0644]