[llvm] [AMDGPU] Make SGPR occupancy the exact inverse of getMaxNumSGPRs (PR #201342)

via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 4 01:43:32 PDT 2026


================
@@ -50,6 +53,29 @@ const AMDGPUMCExpr *AMDGPUMCExpr::create(VariantKind Kind,
   return new (Ctx) AMDGPUMCExpr(Kind, Args, Ctx);
 }
 
+unsigned AMDGPUMCExpr::getNumExpectedArgs(VariantKind Kind) {
+  switch (Kind) {
+  case AGVK_None:
----------------
michaelselehov wrote:

Agreed — `AGVK_None` is the invalid sentinel (the constructor already asserts `Kind != AGVK_None`), not a variadic kind. Gave it its own bailing case instead of folding it into the `return 0` group.

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


More information about the llvm-commits mailing list