AMDGPU: Check if operand RC contains register used when printing
authorPetar Avramovic <Petar.Avramovic@amd.com>
Fri, 9 Dec 2022 16:55:31 +0000 (17:55 +0100)
committerPetar Avramovic <Petar.Avramovic@amd.com>
Fri, 9 Dec 2022 16:55:57 +0000 (17:55 +0100)
commitcc6b10d1ee915e47b3beb68384c6a60b6453ddc7
treec918a9f4da629a4aa3d5ccbc8cadfa3810f6a8dd
parenta1ceacd050178908e02d2fb77fdf0c4de43159d0
AMDGPU: Check if operand RC contains register used when printing

Disassembler can successfully decode sgpr register when only vgpr
registers are valid for the operand (e.g. VReg_* and VISrc_* operands).
In InstPrinter, detect when operand register class does not contain
register that is being printed. Does not result in an error.
Intended use is for disassembler tests.

Differential Revision: https://reviews.llvm.org/D139646
llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp
llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUInstPrinter.cpp
llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp
llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.h
llvm/test/MC/Disassembler/AMDGPU/decode-err.txt