[llvm] [AMDGPU] Fix hw stage metadata setting for unsigned values (PR #154502)

Jay Foad via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 20 03:55:23 PDT 2025


================
@@ -1061,6 +1061,17 @@ VersionTuple AMDGPUPALMetadata::getPALVersion() {
   return VersionTuple(getPALVersion(0), getPALVersion(1));
 }
 
+// Set the field in a given .hardware_stages entry to a maximum value
+void AMDGPUPALMetadata::updateHwStageMaximum(unsigned CC, StringRef field,
+                                             unsigned Val) {
+  auto HwStageFieldMapNode = getHwStage(CC);
+  auto It = HwStageFieldMapNode.find(field);
+  if (It == HwStageFieldMapNode.end())
+    HwStageFieldMapNode[field] = Val;
+  else
----------------
jayfoad wrote:

You could perhaps use `operator[]` for this purpose, if you can detect whether it has inserted a new empty node.

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


More information about the llvm-commits mailing list