[AMDGPU] Select VGPR versions of MFMA if possible
commitaeaf85b9c283c61413c14b52f0f289348eab6a5d
authorStanislav Mekhanoshin <Stanislav.Mekhanoshin@amd.com>
Thu, 13 Jan 2022 00:03:16 +0000 (12 16:03 -0800)
committerStanislav Mekhanoshin <Stanislav.Mekhanoshin@amd.com>
Tue, 8 Feb 2022 18:19:41 +0000 (8 10:19 -0800)
tree6b063244787cd9218f0c5de1b7f568d3ae617248
parent2abd7f13bc742dc6d08f00c41de42cb0c26f17dc
[AMDGPU] Select VGPR versions of MFMA if possible

We can select _vgprcd versions of MAI instructions and have no
AGPRs with the whole budget left for VGPRs if:

1. This is a kernel;
2. It has no calls;
3. It runs at least on 2 waves thus having not more that 256 VGPRs.
4. There is no inline asm requesting AGPRs.

Differential Revision: https://reviews.llvm.org/D117253
16 files changed:
llvm/lib/Target/AMDGPU/AMDGPURegisterBankInfo.cpp
llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.cpp
llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.h
llvm/lib/Target/AMDGPU/VOP3PInstructions.td
llvm/test/CodeGen/AMDGPU/GlobalISel/llvm.amdgcn.mfma.gfx90a.ll
llvm/test/CodeGen/AMDGPU/acc-ldst.ll
llvm/test/CodeGen/AMDGPU/gfx90a-enc.ll
llvm/test/CodeGen/AMDGPU/llvm.amdgcn.mfma.bf16.ll
llvm/test/CodeGen/AMDGPU/llvm.amdgcn.mfma.gfx90a.ll
llvm/test/CodeGen/AMDGPU/llvm.amdgcn.mfma.i8.ll
llvm/test/CodeGen/AMDGPU/llvm.amdgcn.mfma.ll
llvm/test/CodeGen/AMDGPU/mfma-bf16-vgpr-cd-select.ll [new file with mode: 0644]
llvm/test/CodeGen/AMDGPU/mfma-cd-select.ll [new file with mode: 0644]
llvm/test/CodeGen/AMDGPU/mfma-loop.ll
llvm/test/CodeGen/AMDGPU/mfma-vgpr-cd-select.ll [new file with mode: 0644]
llvm/test/CodeGen/AMDGPU/partial-regcopy-and-spill-missed-at-regalloc.ll