Generate getRegBankFromRegClass, referenced from ARM implementation. Currently LLT Ty is unused.
Details
Diff Detail
Event Timeline
Do you plan to revive this at some point? It would be great to move more of the regbank boilerplate from C++ to TableGen
Failed Tests (4):
cfi-devirt-lld-thinlto-x86_64 :: icall/bad-signature.c cfi-devirt-lld-x86_64 :: icall/bad-signature.c cfi-standalone-lld-thinlto-x86_64 :: icall/bad-signature.c cfi-standalone-lld-x86_64 :: icall/bad-signature.c
Please upload the patch with full context using -U99999 as documented here https://llvm.org/docs/Phabricator.html#requesting-a-review-via-the-web-interface
When I build llc with this patch, with AMDGPU as a target, I get a lot of warnings.
E.g.
Included from /Users/gruyere/llvm-project/llvm/lib/Target/AMDGPU/AMDGPU.td:1439: /Users/gruyere/llvm-project/llvm/lib/Target/AMDGPU/AMDGPURegisterBanks.td:13:1: warning: Register class 'AV_128' is already mapped to register bank 'AGPR'. def VGPRRegBank : RegisterBank<"VGPR", ^ Included from /Users/gruyere/llvm-project/llvm/lib/Target/AMDGPU/AMDGPU.td:1439: /Users/gruyere/llvm-project/llvm/lib/Target/AMDGPU/AMDGPURegisterBanks.td:13:1: warning: Register class 'AV_160' is already mapped to register bank 'AGPR'. def VGPRRegBank : RegisterBank<"VGPR", ^
Is that expected?
AV_* classes are for operands that can be one of two different regbanks. You can't unambiguously go back from the class to the register bank. At the moment these are unallocatable classes, although this will probably be changing soon. I'm not really sure what this code should do in this case.
llvm/lib/Target/AArch64/GISel/AArch64RegisterBankInfo.cpp | ||
---|---|---|
266 ↗ | (On Diff #336713) | This register class is missing from the table-generated version of this function in AArch64. |
Saying these are AGPR bank is definitely the wrong answer though. If it's going to be wrong, just saying VGPR would be a better choice
llvm/utils/TableGen/RegisterBankEmitter.cpp | ||
---|---|---|
305 | QualifiedBankID is only used here - why create a std::string when you could just pass each of the the components to OS? |
llvm/lib/Target/AArch64/GISel/AArch64RegisterBankInfo.cpp | ||
---|---|---|
266 ↗ | (On Diff #336713) | @paperchalice Have you been able to move these remaining classes to tablegen yet? |
llvm/lib/Target/AArch64/GISel/AArch64RegisterBankInfo.cpp | ||
---|---|---|
266 ↗ | (On Diff #336713) | Some tests failed if changing def GPRRegBank : RegisterBank<"GPR", [GPR64all]>; to def GPRRegBank : RegisterBank<"GPR", [GPR64all, WSeqPairsClass, XSeqPairsClass]>;, because the code assume GPR is 64-bit, but the size of XSeqPairsClass is 128. |
clang-format: please reformat the code