[PATCH] D121418: [AMDGPU] Add symbolic names for gfx940 HWREGs

Stanislav Mekhanoshin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 11 11:10:27 PST 2022


rampitec added inline comments.


================
Comment at: llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp:1083
+bool isValidHwreg(int64_t Id, const MCSubtargetInfo &STI, StringRef Name) {
+  if (isGFX10(STI) && Name == "HW_REG_HW_ID") // An alias
+    return true;
----------------
foad wrote:
> I don't understand why you need to handle this alias here and on line 1092 below, and the old code had no mention of it?
This is because the alias is not recognized by the code at 1087 and we exit. But the check at 1092 is not needed, removed.


================
Comment at: llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp:1104
+  if (Id == ID_HW_ID)
+    return isSI(STI) || isCI(STI) || isVI(STI) || isGFX9(STI);
+
----------------
foad wrote:
> We also return true for GFX10Plus above, so doesn't that mean that ID_HW_ID needs no special handling at all?
Yes, it is not needed anymore. Removed.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D121418/new/

https://reviews.llvm.org/D121418



More information about the llvm-commits mailing list