[llvm] [AMDGPU] Remove duplicate SGPR limit diagnostics from getSIProgramInfo (PR #192232)

Stanislav Mekhanoshin via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 15 11:48:11 PDT 2026


================
@@ -1103,18 +1100,15 @@ void AMDGPUAsmPrinter::getSIProgramInfo(SIProgramInfo &ProgInfo,
                                    MaxWaves, MFI->getDynamicVGPRBlockSize()))},
                               Ctx);
 
+  // Clamp total SGPRs (including ExtraSGPRs) for correct register block
+  // encoding. The diagnostic is emitted by validateMCResourceInfo() during
+  // doFinalization to avoid duplicate error messages.
   if (STM.getGeneration() <= AMDGPUSubtarget::SEA_ISLANDS ||
       STM.hasSGPRInitBug()) {
     unsigned MaxAddressableNumSGPRs = STM.getAddressableNumSGPRs();
     uint64_t NumSgpr;
     if (TryGetMCExprValue(ProgInfo.NumSGPR, NumSgpr) &&
         NumSgpr > MaxAddressableNumSGPRs) {
-      // This can happen due to a compiler bug or when using inline asm to use
-      // the registers which are usually reserved for vcc etc.
-      LLVMContext &Ctx = MF.getFunction().getContext();
-      Ctx.diagnose(DiagnosticInfoResourceLimit(
-          MF.getFunction(), "scalar registers", NumSgpr, MaxAddressableNumSGPRs,
-          DS_Error, DK_ResourceLimit));
       ProgInfo.NumSGPR = CreateExpr(MaxAddressableNumSGPRs);
----------------
rampitec wrote:

It is not `-1` if I read AMDGPUUsage.rst correctly. Just the number.

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


More information about the llvm-commits mailing list