[llvm] [AMDGPU] Update code object metadata for kernarg preload (PR #134666)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 24 06:18:43 PDT 2025


================
@@ -176,6 +179,37 @@ AMDGPUFunctionArgInfo AMDGPUFunctionArgInfo::fixedABILayout() {
   return AI;
 }
 
+SmallVector<const KernArgPreloadDescriptor *, 4>
+AMDGPUFunctionArgInfo::getPreloadDescriptorsForArgIdx(unsigned ArgIdx) const {
+  SmallVector<const KernArgPreloadDescriptor *, 4> Results;
+  for (const auto &KV : PreloadKernArgs) {
+    if (KV.second.OrigArgIdx == ArgIdx)
+      Results.push_back(&KV.second);
+  }
+
+  stable_sort(Results, [](const KernArgPreloadDescriptor *A,
----------------
arsenm wrote:

The map is just over an integer index, can you use IndexedMap instead and avoid the sort?

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


More information about the llvm-commits mailing list