[PATCH] D141643: AMDGPU: Put un-initiaized enumerators together in an enum definition.

Changpeng Fang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 12 16:22:23 PST 2023


cfang created this revision.
cfang added reviewers: arsenm, bcahoon.
Herald added subscribers: kosarev, foad, kerbowa, hiraditya, tpr, dstuttard, yaxunl, jvesely, kzhuravl.
Herald added a project: All.
cfang requested review of this revision.
Herald added a subscriber: wdng.
Herald added a project: LLVM.

For any enumerator whose definition does not have an initializer, the associated value is the value of the previous enumerator plus one.
In order to avoid the possibility that two unrelated enumerators to have the same value, we should try to cluster the uninitialized enumerators together.


https://reviews.llvm.org/D141643

Files:
  llvm/lib/Target/AMDGPU/SIDefines.h


Index: llvm/lib/Target/AMDGPU/SIDefines.h
===================================================================
--- llvm/lib/Target/AMDGPU/SIDefines.h
+++ llvm/lib/Target/AMDGPU/SIDefines.h
@@ -194,6 +194,12 @@
   OPERAND_REG_INLINE_AC_V2INT32,
   OPERAND_REG_INLINE_AC_V2FP32,
 
+  // Operand for source modifiers for VOP instructions
+  OPERAND_INPUT_MODS,
+
+  // Operand for SDWA instructions
+  OPERAND_SDWA_VOPC_DST,
+
   OPERAND_REG_IMM_FIRST = OPERAND_REG_IMM_INT32,
   OPERAND_REG_IMM_LAST = OPERAND_REG_IMM_V2FP32,
 
@@ -207,14 +213,7 @@
   OPERAND_SRC_LAST = OPERAND_REG_INLINE_C_LAST,
 
   OPERAND_KIMM_FIRST = OPERAND_KIMM32,
-  OPERAND_KIMM_LAST = OPERAND_KIMM16,
-
-  // Operand for source modifiers for VOP instructions
-  OPERAND_INPUT_MODS,
-
-  // Operand for SDWA instructions
-  OPERAND_SDWA_VOPC_DST
-
+  OPERAND_KIMM_LAST = OPERAND_KIMM16
 };
 }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D141643.488808.patch
Type: text/x-patch
Size: 869 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230113/3d105326/attachment.bin>


More information about the llvm-commits mailing list