[llvm] [AMDGPU] Account for inline asm size in inst_pref_size calculation (PR #192306)

Jay Foad via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 27 07:27:29 PDT 2026


================
@@ -190,6 +197,33 @@ bool AMDGPUMCExpr::evaluateOccupancy(MCValue &Res,
   return true;
 }
 
+/// Get the inst_pref_size field width for the given subtarget.
+static unsigned getInstPrefSizeFieldWidth(const MCSubtargetInfo *STI) {
+  auto Version = getIsaVersion(STI->getCPU());
+  assert(Version.Major >= 11 && "inst_pref_size only exists on GFX11+");
+  if (Version.Major == 11)
+    return amdhsa::COMPUTE_PGM_RSRC3_GFX11_INST_PREF_SIZE_WIDTH;
+  return amdhsa::COMPUTE_PGM_RSRC3_GFX12_PLUS_INST_PREF_SIZE_WIDTH;
+}
+
+bool AMDGPUMCExpr::evaluateInstPrefSize(MCValue &Res,
+                                        const MCAssembler *Asm) const {
+  assert(Args.size() == 1 &&
+         "AMDGPUMCExpr Argument count incorrect for InstPrefSize");
----------------
jayfoad wrote:

Yes. I thought (obviously without checking) that that was done as part of #193859.

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


More information about the llvm-commits mailing list