[llvm] [AMDGPU][NFCI] Decouple actual register encodings from HWEncoding values. (PR #69452)

Ivan Kosarev via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 19 03:31:07 PDT 2023


================
@@ -38,9 +38,16 @@ using namespace llvm;
 
 #define DEBUG_TYPE "amdgpu-disassembler"
 
-#define SGPR_MAX                                                               \
-  (isGFX10Plus() ? AMDGPU::EncValues::SGPR_MAX_GFX10                           \
-                 : AMDGPU::EncValues::SGPR_MAX_SI)
+enum : unsigned {
----------------
kosarev wrote:

I think this goes well beyond the scope of this patch and I personally wouldn't propose such a change, because as I already mentioned elsewhere introducing and maintaining this kind of named constants is not an obvious improvement to me (but wouldn't mind terribly either if someone else is going to propose that).

So I can give give `LITERAL_CONST` some more use here, if that's seen critical, but would prefer to not deviate from the purposes of this patch trying to refine the encoder.

https://github.com/llvm/llvm-project/pull/69452


More information about the llvm-commits mailing list