Skip to content

[AMDGPU] Replace dynamic VGPR feature with attribute #133444

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 20 commits into from
Jun 24, 2025
Merged

Conversation

rovka
Copy link
Collaborator

@rovka rovka commented Mar 28, 2025

Use a function attribute (amdgpu-dynamic-vgpr) instead of a subtarget feature, as requested in #130030.

Use a function attribute (amdgpu-dynamic-vgpr) instead of a subtarget
feature, as requested in llvm#130030.
@llvmbot
Copy link
Member

llvmbot commented Mar 28, 2025

@llvm/pr-subscribers-backend-amdgpu

Author: Diana Picus (rovka)

Changes

Use a function attribute (amdgpu-dynamic-vgpr) instead of a subtarget feature, as requested in #130030.


Patch is 99.47 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/133444.diff

30 Files Affected:

  • (modified) llvm/docs/AMDGPUUsage.rst (+5-5)
  • (modified) llvm/lib/Target/AMDGPU/AMDGPU.td (-6)
  • (modified) llvm/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp (+9-9)
  • (modified) llvm/lib/Target/AMDGPU/AMDGPUPromoteAlloca.cpp (+5-1)
  • (modified) llvm/lib/Target/AMDGPU/GCNIterativeScheduler.cpp (+15-12)
  • (modified) llvm/lib/Target/AMDGPU/GCNNSAReassign.cpp (+1-1)
  • (modified) llvm/lib/Target/AMDGPU/GCNRegPressure.cpp (+8-6)
  • (modified) llvm/lib/Target/AMDGPU/GCNRegPressure.h (+6-6)
  • (modified) llvm/lib/Target/AMDGPU/GCNSchedStrategy.cpp (+20-18)
  • (modified) llvm/lib/Target/AMDGPU/GCNSubtarget.cpp (+14-6)
  • (modified) llvm/lib/Target/AMDGPU/GCNSubtarget.h (+9-12)
  • (modified) llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUMCExpr.cpp (+2-1)
  • (modified) llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUMCExpr.h (+1)
  • (modified) llvm/lib/Target/AMDGPU/SIFormMemoryClauses.cpp (+1-1)
  • (modified) llvm/lib/Target/AMDGPU/SIFrameLowering.cpp (+3-3)
  • (modified) llvm/lib/Target/AMDGPU/SIInsertWaitcnts.cpp (+4-4)
  • (modified) llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.cpp (+4)
  • (modified) llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.h (+8)
  • (modified) llvm/lib/Target/AMDGPU/SIRegisterInfo.cpp (+1-1)
  • (modified) llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp (+17-17)
  • (modified) llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.h (+6-6)
  • (modified) llvm/test/CodeGen/AMDGPU/dynamic-vgpr-reserve-stack-for-cwsr.ll (+5-5)
  • (modified) llvm/test/CodeGen/AMDGPU/machine-function-info-cwsr.ll (+2-2)
  • (added) llvm/test/CodeGen/AMDGPU/pal-metadata-3.0-callable-dvgpr.ll (+305)
  • (modified) llvm/test/CodeGen/AMDGPU/pal-metadata-3.0-callable.ll (-2)
  • (added) llvm/test/CodeGen/AMDGPU/pal-metadata-3.0-dvgpr.ll (+205)
  • (modified) llvm/test/CodeGen/AMDGPU/pal-metadata-3.0.ll (+4-9)
  • (added) llvm/test/CodeGen/AMDGPU/release-vgprs-gfx12-dvgpr.mir (+340)
  • (modified) llvm/test/CodeGen/AMDGPU/release-vgprs-gfx12.mir (+19-38)
  • (modified) llvm/unittests/Target/AMDGPU/AMDGPUUnitTests.cpp (+19-19)
diff --git a/llvm/docs/AMDGPUUsage.rst b/llvm/docs/AMDGPUUsage.rst
index ab507e3714ebb..daedc324c5d0a 100644
--- a/llvm/docs/AMDGPUUsage.rst
+++ b/llvm/docs/AMDGPUUsage.rst
@@ -759,11 +759,6 @@ For example:
                                                   performant than code generated for XNACK replay
                                                   disabled.
 
-     dynamic-vgpr    TODO                         Represents the "Dynamic VGPR" hardware mode, introduced in GFX12.
-                                                  Waves launched in this mode may allocate or deallocate the VGPRs
-                                                  using dedicated instructions, but may not send the DEALLOC_VGPRS
-                                                  message.
-
      =============== ============================ ==================================================
 
 .. _amdgpu-target-id:
@@ -1743,6 +1738,11 @@ The AMDGPU backend supports the following LLVM IR attributes.
 
      "amdgpu-promote-alloca-to-vector-vgpr-ratio"     Ratio of VGPRs to budget for promoting alloca to vectors.
 
+     "amdgpu-dynamic-vgpr"                            Represents the "Dynamic VGPR" hardware mode, introduced in GFX12.
+                                                      Waves launched in this mode may allocate or deallocate the VGPRs
+                                                      using dedicated instructions, but may not send the DEALLOC_VGPRS
+                                                      message.
+
      ================================================ ==========================================================
 
 Calling Conventions
diff --git a/llvm/lib/Target/AMDGPU/AMDGPU.td b/llvm/lib/Target/AMDGPU/AMDGPU.td
index 84619dd656f35..8bd9fcd8e04e7 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPU.td
+++ b/llvm/lib/Target/AMDGPU/AMDGPU.td
@@ -1257,12 +1257,6 @@ def FeatureXF32Insts : SubtargetFeature<"xf32-insts",
    "v_mfma_f32_16x16x8_xf32 and v_mfma_f32_32x32x4_xf32"
  >;
 
-def FeatureDynamicVGPR : SubtargetFeature <"dynamic-vgpr",
-  "DynamicVGPR",
-  "true",
-  "Enable dynamic VGPR mode"
->;
-
 def FeatureDynamicVGPRBlockSize32 : SubtargetFeature<"dynamic-vgpr-block-size-32",
   "DynamicVGPRBlockSize32",
   "true",
diff --git a/llvm/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp b/llvm/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp
index 800e2b9c0e657..8e3f5aef8bd05 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp
+++ b/llvm/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp
@@ -452,13 +452,13 @@ void AMDGPUAsmPrinter::validateMCResourceInfo(Function &F) {
       uint64_t TotalNumVgpr =
           getTotalNumVGPRs(STM.hasGFX90AInsts(), NumAgpr, NumVgpr);
       uint64_t NumVGPRsForWavesPerEU = std::max(
-          {TotalNumVgpr, (uint64_t)1, (uint64_t)STM.getMinNumVGPRs(MaxWaves)});
+          {TotalNumVgpr, (uint64_t)1, (uint64_t)STM.getMinNumVGPRs(MaxWaves, MFI.isDynamicVGPREnabled())});
       uint64_t NumSGPRsForWavesPerEU = std::max(
           {NumSgpr, (uint64_t)1, (uint64_t)STM.getMinNumSGPRs(MaxWaves)});
       const MCExpr *OccupancyExpr = AMDGPUMCExpr::createOccupancy(
           STM.getOccupancyWithWorkGroupSizes(*MF).second,
           MCConstantExpr::create(NumSGPRsForWavesPerEU, OutContext),
-          MCConstantExpr::create(NumVGPRsForWavesPerEU, OutContext), STM,
+          MCConstantExpr::create(NumVGPRsForWavesPerEU, OutContext), MFI.isDynamicVGPREnabled(), STM,
           OutContext);
       uint64_t Occupancy;
 
@@ -1081,7 +1081,7 @@ void AMDGPUAsmPrinter::getSIProgramInfo(SIProgramInfo &ProgInfo,
                               Ctx);
   ProgInfo.NumVGPRsForWavesPerEU =
       AMDGPUMCExpr::createMax({ProgInfo.NumVGPR, CreateExpr(1ul),
-                               CreateExpr(STM.getMinNumVGPRs(MaxWaves))},
+                               CreateExpr(STM.getMinNumVGPRs(MaxWaves, MFI->isDynamicVGPREnabled()))},
                               Ctx);
 
   if (STM.getGeneration() <= AMDGPUSubtarget::SEA_ISLANDS ||
@@ -1255,7 +1255,7 @@ void AMDGPUAsmPrinter::getSIProgramInfo(SIProgramInfo &ProgInfo,
 
   ProgInfo.Occupancy = AMDGPUMCExpr::createOccupancy(
       STM.computeOccupancy(F, ProgInfo.LDSSize).second,
-      ProgInfo.NumSGPRsForWavesPerEU, ProgInfo.NumVGPRsForWavesPerEU, STM, Ctx);
+      ProgInfo.NumSGPRsForWavesPerEU, ProgInfo.NumVGPRsForWavesPerEU, MFI->isDynamicVGPREnabled(), STM, Ctx);
 
   const auto [MinWEU, MaxWEU] =
       AMDGPU::getIntegerPairAttribute(F, "amdgpu-waves-per-eu", {0, 0}, true);
@@ -1404,7 +1404,7 @@ void AMDGPUAsmPrinter::EmitProgramInfoSI(const MachineFunction &MF,
 // Helper function to add common PAL Metadata 3.0+
 static void EmitPALMetadataCommon(AMDGPUPALMetadata *MD,
                                   const SIProgramInfo &CurrentProgramInfo,
-                                  CallingConv::ID CC, const GCNSubtarget &ST) {
+                                  CallingConv::ID CC, const GCNSubtarget &ST, bool IsDynamicVGPR) {
   if (ST.hasIEEEMode())
     MD->setHwStage(CC, ".ieee_mode", (bool)CurrentProgramInfo.IEEEMode);
 
@@ -1416,7 +1416,7 @@ static void EmitPALMetadataCommon(AMDGPUPALMetadata *MD,
                    (bool)CurrentProgramInfo.TrapHandlerEnable);
     MD->setHwStage(CC, ".excp_en", CurrentProgramInfo.EXCPEnable);
 
-    if (ST.isDynamicVGPREnabled())
+    if (IsDynamicVGPR)
       MD->setComputeRegisters(".dynamic_vgpr_en", true);
   }
 
@@ -1443,7 +1443,7 @@ void AMDGPUAsmPrinter::EmitPALMetadata(const MachineFunction &MF,
   // For targets that support dynamic VGPRs, set the number of saved dynamic
   // VGPRs (if any) in the PAL metadata.
   const GCNSubtarget &STM = MF.getSubtarget<GCNSubtarget>();
-  if (STM.isDynamicVGPREnabled() &&
+  if (MFI->isDynamicVGPREnabled() &&
       MFI->getScratchReservedForDynamicVGPRs() > 0)
     MD->setHwStage(CC, ".dynamic_vgpr_saved_count",
                    MFI->getScratchReservedForDynamicVGPRs() / 4);
@@ -1469,7 +1469,7 @@ void AMDGPUAsmPrinter::EmitPALMetadata(const MachineFunction &MF,
     MD->setHwStage(CC, ".debug_mode", (bool)CurrentProgramInfo.DebugMode);
     MD->setHwStage(CC, ".scratch_en", msgpack::Type::Boolean,
                    CurrentProgramInfo.ScratchEnable);
-    EmitPALMetadataCommon(MD, CurrentProgramInfo, CC, STM);
+    EmitPALMetadataCommon(MD, CurrentProgramInfo, CC, STM, MFI->isDynamicVGPREnabled());
   }
 
   // ScratchSize is in bytes, 16 aligned.
@@ -1540,7 +1540,7 @@ void AMDGPUAsmPrinter::emitPALFunctionMetadata(const MachineFunction &MF) {
     MD->setRsrc2(CallingConv::AMDGPU_CS,
                  CurrentProgramInfo.getComputePGMRSrc2(Ctx), Ctx);
   } else {
-    EmitPALMetadataCommon(MD, CurrentProgramInfo, CallingConv::AMDGPU_CS, ST);
+    EmitPALMetadataCommon(MD, CurrentProgramInfo, CallingConv::AMDGPU_CS, ST, MF.getInfo<SIMachineFunctionInfo>()->isDynamicVGPREnabled());
   }
 
   // Set optional info
diff --git a/llvm/lib/Target/AMDGPU/AMDGPUPromoteAlloca.cpp b/llvm/lib/Target/AMDGPU/AMDGPUPromoteAlloca.cpp
index 98a70c0dbb912..8f9a7aefb104e 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPUPromoteAlloca.cpp
+++ b/llvm/lib/Target/AMDGPU/AMDGPUPromoteAlloca.cpp
@@ -199,8 +199,12 @@ unsigned getMaxVGPRs(const TargetMachine &TM, const Function &F) {
   if (!TM.getTargetTriple().isAMDGCN())
     return 128;
 
+  bool IsDynamicVGPR = false;
+  if (F.hasFnAttribute("amdgpu-dynamic-vgpr"))
+    IsDynamicVGPR = F.getFnAttribute("amdgpu-dynamic-vgpr").getValueAsBool();
+
   const GCNSubtarget &ST = TM.getSubtarget<GCNSubtarget>(F);
-  unsigned MaxVGPRs = ST.getMaxNumVGPRs(ST.getWavesPerEU(F).first);
+  unsigned MaxVGPRs = ST.getMaxNumVGPRs(ST.getWavesPerEU(F).first, IsDynamicVGPR);
 
   // A non-entry function has only 32 caller preserved registers.
   // Do not promote alloca which will force spilling unless we know the function
diff --git a/llvm/lib/Target/AMDGPU/GCNIterativeScheduler.cpp b/llvm/lib/Target/AMDGPU/GCNIterativeScheduler.cpp
index da065e8d8cb6b..ded5c270e3cd9 100644
--- a/llvm/lib/Target/AMDGPU/GCNIterativeScheduler.cpp
+++ b/llvm/lib/Target/AMDGPU/GCNIterativeScheduler.cpp
@@ -426,13 +426,14 @@ void GCNIterativeScheduler::sortRegionsByPressure(unsigned TargetOcc) {
 unsigned GCNIterativeScheduler::tryMaximizeOccupancy(unsigned TargetOcc) {
   // TODO: assert Regions are sorted descending by pressure
   const auto &ST = MF.getSubtarget<GCNSubtarget>();
-  const auto Occ = Regions.front()->MaxPressure.getOccupancy(ST);
+  const bool IsDynamicVGPR = MF.getInfo<SIMachineFunctionInfo>()->isDynamicVGPREnabled();
+  const auto Occ = Regions.front()->MaxPressure.getOccupancy(ST, IsDynamicVGPR);
   LLVM_DEBUG(dbgs() << "Trying to improve occupancy, target = " << TargetOcc
                     << ", current = " << Occ << '\n');
 
   auto NewOcc = TargetOcc;
   for (auto *R : Regions) {
-    if (R->MaxPressure.getOccupancy(ST) >= NewOcc)
+    if (R->MaxPressure.getOccupancy(ST, IsDynamicVGPR) >= NewOcc)
       break;
 
     LLVM_DEBUG(printRegion(dbgs(), R->Begin, R->End, LIS, 3);
@@ -444,7 +445,7 @@ unsigned GCNIterativeScheduler::tryMaximizeOccupancy(unsigned TargetOcc) {
     LLVM_DEBUG(dbgs() << "Occupancy improvement attempt:\n";
                printSchedRP(dbgs(), R->MaxPressure, MaxRP));
 
-    NewOcc = std::min(NewOcc, MaxRP.getOccupancy(ST));
+    NewOcc = std::min(NewOcc, MaxRP.getOccupancy(ST, IsDynamicVGPR));
     if (NewOcc <= Occ)
       break;
 
@@ -465,9 +466,10 @@ void GCNIterativeScheduler::scheduleLegacyMaxOccupancy(
   const auto &ST = MF.getSubtarget<GCNSubtarget>();
   SIMachineFunctionInfo *MFI = MF.getInfo<SIMachineFunctionInfo>();
   auto TgtOcc = MFI->getMinAllowedOccupancy();
+  bool IsDynamicVGPR = MFI->isDynamicVGPREnabled();
 
   sortRegionsByPressure(TgtOcc);
-  auto Occ = Regions.front()->MaxPressure.getOccupancy(ST);
+  auto Occ = Regions.front()->MaxPressure.getOccupancy(ST, IsDynamicVGPR);
 
   if (TryMaximizeOccupancy && Occ < TgtOcc)
     Occ = tryMaximizeOccupancy(TgtOcc);
@@ -494,19 +496,19 @@ void GCNIterativeScheduler::scheduleLegacyMaxOccupancy(
       const auto RP = getRegionPressure(*R);
       LLVM_DEBUG(printSchedRP(dbgs(), R->MaxPressure, RP));
 
-      if (RP.getOccupancy(ST) < TgtOcc) {
+      if (RP.getOccupancy(ST, IsDynamicVGPR) < TgtOcc) {
         LLVM_DEBUG(dbgs() << "Didn't fit into target occupancy O" << TgtOcc);
         if (R->BestSchedule.get() &&
-            R->BestSchedule->MaxPressure.getOccupancy(ST) >= TgtOcc) {
+            R->BestSchedule->MaxPressure.getOccupancy(ST, IsDynamicVGPR) >= TgtOcc) {
           LLVM_DEBUG(dbgs() << ", scheduling minimal register\n");
           scheduleBest(*R);
         } else {
           LLVM_DEBUG(dbgs() << ", restoring\n");
           Ovr.restoreOrder();
-          assert(R->MaxPressure.getOccupancy(ST) >= TgtOcc);
+          assert(R->MaxPressure.getOccupancy(ST, IsDynamicVGPR) >= TgtOcc);
         }
       }
-      FinalOccupancy = std::min(FinalOccupancy, RP.getOccupancy(ST));
+      FinalOccupancy = std::min(FinalOccupancy, RP.getOccupancy(ST, IsDynamicVGPR));
     }
   }
   MFI->limitOccupancy(FinalOccupancy);
@@ -552,9 +554,10 @@ void GCNIterativeScheduler::scheduleILP(
   const auto &ST = MF.getSubtarget<GCNSubtarget>();
   SIMachineFunctionInfo *MFI = MF.getInfo<SIMachineFunctionInfo>();
   auto TgtOcc = MFI->getMinAllowedOccupancy();
+  bool IsDynamicVGPR = MFI->isDynamicVGPREnabled();
 
   sortRegionsByPressure(TgtOcc);
-  auto Occ = Regions.front()->MaxPressure.getOccupancy(ST);
+  auto Occ = Regions.front()->MaxPressure.getOccupancy(ST, IsDynamicVGPR);
 
   if (TryMaximizeOccupancy && Occ < TgtOcc)
     Occ = tryMaximizeOccupancy(TgtOcc);
@@ -572,17 +575,17 @@ void GCNIterativeScheduler::scheduleILP(
     const auto RP = getSchedulePressure(*R, ILPSchedule);
     LLVM_DEBUG(printSchedRP(dbgs(), R->MaxPressure, RP));
 
-    if (RP.getOccupancy(ST) < TgtOcc) {
+    if (RP.getOccupancy(ST, IsDynamicVGPR) < TgtOcc) {
       LLVM_DEBUG(dbgs() << "Didn't fit into target occupancy O" << TgtOcc);
       if (R->BestSchedule.get() &&
-        R->BestSchedule->MaxPressure.getOccupancy(ST) >= TgtOcc) {
+        R->BestSchedule->MaxPressure.getOccupancy(ST, IsDynamicVGPR) >= TgtOcc) {
         LLVM_DEBUG(dbgs() << ", scheduling minimal register\n");
         scheduleBest(*R);
       }
     } else {
       scheduleRegion(*R, ILPSchedule, RP);
       LLVM_DEBUG(printSchedResult(dbgs(), R, RP));
-      FinalOccupancy = std::min(FinalOccupancy, RP.getOccupancy(ST));
+      FinalOccupancy = std::min(FinalOccupancy, RP.getOccupancy(ST, IsDynamicVGPR));
     }
   }
   MFI->limitOccupancy(FinalOccupancy);
diff --git a/llvm/lib/Target/AMDGPU/GCNNSAReassign.cpp b/llvm/lib/Target/AMDGPU/GCNNSAReassign.cpp
index 13eb0ca539a4c..f3fd6c8564693 100644
--- a/llvm/lib/Target/AMDGPU/GCNNSAReassign.cpp
+++ b/llvm/lib/Target/AMDGPU/GCNNSAReassign.cpp
@@ -251,7 +251,7 @@ bool GCNNSAReassignImpl::run(MachineFunction &MF) {
 
   const SIMachineFunctionInfo *MFI = MF.getInfo<SIMachineFunctionInfo>();
   MaxNumVGPRs = ST->getMaxNumVGPRs(MF);
-  MaxNumVGPRs = std::min(ST->getMaxNumVGPRs(MFI->getOccupancy()), MaxNumVGPRs);
+  MaxNumVGPRs = std::min(ST->getMaxNumVGPRs(MFI->getOccupancy(), MFI->isDynamicVGPREnabled()), MaxNumVGPRs);
   CSRegs = MRI->getCalleeSavedRegs();
 
   using Candidate = std::pair<const MachineInstr*, bool>;
diff --git a/llvm/lib/Target/AMDGPU/GCNRegPressure.cpp b/llvm/lib/Target/AMDGPU/GCNRegPressure.cpp
index f74d12cfab0c0..3088dd2f65a8c 100644
--- a/llvm/lib/Target/AMDGPU/GCNRegPressure.cpp
+++ b/llvm/lib/Target/AMDGPU/GCNRegPressure.cpp
@@ -13,6 +13,7 @@
 
 #include "GCNRegPressure.h"
 #include "AMDGPU.h"
+#include "SIMachineFunctionInfo.h"
 #include "llvm/CodeGen/RegisterPressure.h"
 
 using namespace llvm;
@@ -92,17 +93,18 @@ void GCNRegPressure::inc(unsigned Reg,
 bool GCNRegPressure::less(const MachineFunction &MF, const GCNRegPressure &O,
                           unsigned MaxOccupancy) const {
   const GCNSubtarget &ST = MF.getSubtarget<GCNSubtarget>();
+  bool IsDynamicVGPR = MF.getInfo<SIMachineFunctionInfo>()->isDynamicVGPREnabled();
 
   const auto SGPROcc = std::min(MaxOccupancy,
                                 ST.getOccupancyWithNumSGPRs(getSGPRNum()));
   const auto VGPROcc =
     std::min(MaxOccupancy,
-             ST.getOccupancyWithNumVGPRs(getVGPRNum(ST.hasGFX90AInsts())));
+             ST.getOccupancyWithNumVGPRs(getVGPRNum(ST.hasGFX90AInsts()), IsDynamicVGPR));
   const auto OtherSGPROcc = std::min(MaxOccupancy,
                                 ST.getOccupancyWithNumSGPRs(O.getSGPRNum()));
   const auto OtherVGPROcc =
     std::min(MaxOccupancy,
-             ST.getOccupancyWithNumVGPRs(O.getVGPRNum(ST.hasGFX90AInsts())));
+             ST.getOccupancyWithNumVGPRs(O.getVGPRNum(ST.hasGFX90AInsts()), IsDynamicVGPR));
 
   const auto Occ = std::min(SGPROcc, VGPROcc);
   const auto OtherOcc = std::min(OtherSGPROcc, OtherVGPROcc);
@@ -224,13 +226,13 @@ bool GCNRegPressure::less(const MachineFunction &MF, const GCNRegPressure &O,
                           O.getVGPRNum(ST.hasGFX90AInsts()));
 }
 
-Printable llvm::print(const GCNRegPressure &RP, const GCNSubtarget *ST) {
-  return Printable([&RP, ST](raw_ostream &OS) {
+Printable llvm::print(const GCNRegPressure &RP, const GCNSubtarget *ST, bool IsDynamicVGPR) {
+  return Printable([&RP, ST, IsDynamicVGPR](raw_ostream &OS) {
     OS << "VGPRs: " << RP.Value[GCNRegPressure::VGPR32] << ' '
        << "AGPRs: " << RP.getAGPRNum();
     if (ST)
       OS << "(O"
-         << ST->getOccupancyWithNumVGPRs(RP.getVGPRNum(ST->hasGFX90AInsts()))
+         << ST->getOccupancyWithNumVGPRs(RP.getVGPRNum(ST->hasGFX90AInsts()), IsDynamicVGPR)
          << ')';
     OS << ", SGPRs: " << RP.getSGPRNum();
     if (ST)
@@ -238,7 +240,7 @@ Printable llvm::print(const GCNRegPressure &RP, const GCNSubtarget *ST) {
     OS << ", LVGPR WT: " << RP.getVGPRTuplesWeight()
        << ", LSGPR WT: " << RP.getSGPRTuplesWeight();
     if (ST)
-      OS << " -> Occ: " << RP.getOccupancy(*ST);
+      OS << " -> Occ: " << RP.getOccupancy(*ST, IsDynamicVGPR);
     OS << '\n';
   });
 }
diff --git a/llvm/lib/Target/AMDGPU/GCNRegPressure.h b/llvm/lib/Target/AMDGPU/GCNRegPressure.h
index 7554b9f578fcb..15e86c733ff60 100644
--- a/llvm/lib/Target/AMDGPU/GCNRegPressure.h
+++ b/llvm/lib/Target/AMDGPU/GCNRegPressure.h
@@ -67,9 +67,9 @@ struct GCNRegPressure {
                                                          Value[AGPR_TUPLE]); }
   unsigned getSGPRTuplesWeight() const { return Value[SGPR_TUPLE]; }
 
-  unsigned getOccupancy(const GCNSubtarget &ST) const {
+  unsigned getOccupancy(const GCNSubtarget &ST, bool IsDynamicVGPR) const {
     return std::min(ST.getOccupancyWithNumSGPRs(getSGPRNum()),
-             ST.getOccupancyWithNumVGPRs(getVGPRNum(ST.hasGFX90AInsts())));
+             ST.getOccupancyWithNumVGPRs(getVGPRNum(ST.hasGFX90AInsts()), IsDynamicVGPR));
   }
 
   void inc(unsigned Reg,
@@ -77,8 +77,8 @@ struct GCNRegPressure {
            LaneBitmask NewMask,
            const MachineRegisterInfo &MRI);
 
-  bool higherOccupancy(const GCNSubtarget &ST, const GCNRegPressure& O) const {
-    return getOccupancy(ST) > O.getOccupancy(ST);
+  bool higherOccupancy(const GCNSubtarget &ST, const GCNRegPressure& O, bool IsDynamicVGPR) const {
+    return getOccupancy(ST, IsDynamicVGPR) > O.getOccupancy(ST, IsDynamicVGPR);
   }
 
   /// Compares \p this GCNRegpressure to \p O, returning true if \p this is
@@ -126,7 +126,7 @@ struct GCNRegPressure {
   friend GCNRegPressure max(const GCNRegPressure &P1,
                             const GCNRegPressure &P2);
 
-  friend Printable print(const GCNRegPressure &RP, const GCNSubtarget *ST);
+  friend Printable print(const GCNRegPressure &RP, const GCNSubtarget *ST, bool IsDynamicVGPR);
 };
 
 inline GCNRegPressure max(const GCNRegPressure &P1, const GCNRegPressure &P2) {
@@ -395,7 +395,7 @@ GCNRegPressure getRegPressure(const MachineRegisterInfo &MRI,
 bool isEqual(const GCNRPTracker::LiveRegSet &S1,
              const GCNRPTracker::LiveRegSet &S2);
 
-Printable print(const GCNRegPressure &RP, const GCNSubtarget *ST = nullptr);
+Printable print(const GCNRegPressure &RP, const GCNSubtarget *ST = nullptr, bool IsDynamicVGPR = false);
 
 Printable print(const GCNRPTracker::LiveRegSet &LiveRegs,
                 const MachineRegisterInfo &MRI);
diff --git a/llvm/lib/Target/AMDGPU/GCNSchedStrategy.cpp b/llvm/lib/Target/AMDGPU/GCNSchedStrategy.cpp
index ea9bc88bbe86b..f2900beb5234c 100644
--- a/llvm/lib/Target/AMDGPU/GCNSchedStrategy.cpp
+++ b/llvm/lib/Target/AMDGPU/GCNSchedStrategy.cpp
@@ -95,16 +95,16 @@ void GCNSchedStrategy::initialize(ScheduleDAGMI *DAG) {
 
   if (!KnownExcessRP) {
     VGPRCriticalLimit =
-        std::min(ST.getMaxNumVGPRs(TargetOccupancy), VGPRExcessLimit);
+        std::min(ST.getMaxNumVGPRs(TargetOccupancy, MFI.isDynamicVGPREnabled()), VGPRExcessLimit);
   } else {
     // This is similar to ST.getMaxNumVGPRs(TargetOccupancy) result except
     // returns a reasonably small number for targets with lots of VGPRs, such
     // as GFX10 and GFX11.
     LLVM_DEBUG(dbgs() << "Region is known to spill, use alternative "
                          "VGPRCriticalLimit calculation method.\n");
-
-    unsigned Granule = AMDGPU::IsaInfo::getVGPRAllocGranule(&ST);
-    unsigned Addressable = AMDGPU::IsaInfo::getAddressableNumVGPRs(&ST);
+    bool IsDynamicVGPR = MFI.isDynamicVGPREnabled();
+    unsigned Granule = AMDGPU::IsaInfo::getVGPRAllocGranule(&ST, IsDynamicVGPR);
+    unsigned Addressable = AMDGPU::IsaInfo::getAddressableNumVGPRs(&ST, IsDynamicVGPR);
     unsigned VGPRBudget = alignDown(Addressable / TargetOccupancy, Granule);
     VGPRBudget = std::max(VGPRBudget, Granule);
     VGPRCriticalLimit = std::min(VGPRBudget, VGPRExcessLimit);
@@ -1126,7 +1126,7 @@ void UnclusteredHighRPStage::finalizeGCNSchedStage() {
   if (DAG.MinOccupancy > InitialOccupancy) {
     for (unsigned IDX = 0; IDX < DAG.Pressure.size(); ++IDX)
       DAG.RegionsWithMinOcc[IDX] =
-          DAG.Pressure[IDX].getOccupancy(DAG.ST) == DAG.MinOccupancy;
+          DAG.Pressure[IDX].getOccupancy(DAG.ST, DAG.MFI.isDynamicVGPREnabled()) == DAG.MinOccupancy;
 
     LLVM_DEBUG(dbgs() << StageID
                       << " stage successfully increased occupancy to "
@@ -1266,11 +1266,13 @@ void GCNSchedStage::checkScheduling() {
   LLVM_DEBUG(dbgs() << "Pressure after scheduling: " << print(PressureAfter));
   LLVM_DEBUG(dbgs() << "Region: " << RegionIdx << ".\n");
 
+  bool IsDynamicVGPR = DAG.MFI.i...
[truncated]

@rovka rovka requested a review from arsenm March 28, 2025 14:03
Copy link

github-actions bot commented Apr 25, 2025

✅ With the latest revision this PR passed the C/C++ code formatter.

@rovka
Copy link
Collaborator Author

rovka commented Jun 2, 2025

Ping.

@bmb0537
Copy link

bmb0537 commented Jun 20, 2025

I have a question, how do programmers use this feature?

@rovka
Copy link
Collaborator Author

rovka commented Jun 23, 2025

I have a question, how do programmers use this feature?

This is currently only used by the compiler, it is not intended to be used by programmers in its current form.

AMDGPU::IsaInfo::getVGPRAllocGranule(&ST)) *
4,
FrameInfo.getMaxAlign());
unsigned VGPRSize = llvm::alignTo(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code format is sooo ugly but I understand it is what clang-format likes…

@bmb0537
Copy link

bmb0537 commented Jun 24, 2025

I have a question, how do programmers use this feature?

This is currently only used by the compiler, it is not intended to be used by programmers in its current form.

May I ask, in what way will it ultimately be provided to programmers for use?

@rovka rovka merged commit a201f88 into llvm:main Jun 24, 2025
12 checks passed
@rovka
Copy link
Collaborator Author

rovka commented Jun 24, 2025

I have a question, how do programmers use this feature?

This is currently only used by the compiler, it is not intended to be used by programmers in its current form.

May I ask, in what way will it ultimately be provided to programmers for use?

I can't really comment on that.

You can get some general idea about how it's currently used in this 3rd party article.

@llvm-ci
Copy link
Collaborator

llvm-ci commented Jun 24, 2025

LLVM Buildbot has detected a new failure on builder llvm-clang-x86_64-expensive-checks-ubuntu running on as-builder-4 while building llvm at step 7 "test-check-all".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/187/builds/7245

Here is the relevant piece of the build log for the reference
Step 7 (test-check-all) failure: Test just built components: check-all completed (failure)
******************** TEST 'LLVM :: CodeGen/AMDGPU/pal-metadata-3.0-callable-dvgpr.ll' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
/home/buildbot/worker/as-builder-4/ramdisk/expensive-checks/build/bin/llc -mtriple=amdgcn--amdpal -mcpu=gfx1200 -verify-machineinstrs < /home/buildbot/worker/as-builder-4/ramdisk/expensive-checks/llvm-project/llvm/test/CodeGen/AMDGPU/pal-metadata-3.0-callable-dvgpr.ll | /home/buildbot/worker/as-builder-4/ramdisk/expensive-checks/build/bin/FileCheck /home/buildbot/worker/as-builder-4/ramdisk/expensive-checks/llvm-project/llvm/test/CodeGen/AMDGPU/pal-metadata-3.0-callable-dvgpr.ll # RUN: at line 1
+ /home/buildbot/worker/as-builder-4/ramdisk/expensive-checks/build/bin/llc -mtriple=amdgcn--amdpal -mcpu=gfx1200 -verify-machineinstrs
+ /home/buildbot/worker/as-builder-4/ramdisk/expensive-checks/build/bin/FileCheck /home/buildbot/worker/as-builder-4/ramdisk/expensive-checks/llvm-project/llvm/test/CodeGen/AMDGPU/pal-metadata-3.0-callable-dvgpr.ll
/home/buildbot/worker/as-builder-4/ramdisk/expensive-checks/llvm-project/llvm/test/CodeGen/AMDGPU/pal-metadata-3.0-callable-dvgpr.ll:83:15: error: CHECK-NEXT: expected string not found in input
; CHECK-NEXT: .sgpr_count: 0x1
              ^
<stdin>:933:14: note: scanning from here
 .lds_size: 0
             ^
<stdin>:934:2: note: possible intended match here
 .sgpr_count: 0x21
 ^

Input file: <stdin>
Check file: /home/buildbot/worker/as-builder-4/ramdisk/expensive-checks/llvm-project/llvm/test/CodeGen/AMDGPU/pal-metadata-3.0-callable-dvgpr.ll

-dump-input=help explains the following input dump.

Input was:
<<<<<<
           .
           .
           .
         928:  .sgpr_count: 0x22 
         929:  .stack_frame_size_in_bytes: 0x10 
         930:  .vgpr_count: 0x3 
         931:  multiple_stack: 
         932:  .backend_stack_size: 0x24 
         933:  .lds_size: 0 
next:83'0                  X error: no match found
         934:  .sgpr_count: 0x21 
next:83'0     ~~~~~~~~~~~~~~~~~~~
next:83'1      ?                  possible intended match
         935:  .stack_frame_size_in_bytes: 0x24 
next:83'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         936:  .vgpr_count: 0x3 
next:83'0     ~~~~~~~~~~~~~~~~~~
         937:  no_stack: 
next:83'0     ~~~~~~~~~~~
         938:  .backend_stack_size: 0 
next:83'0     ~~~~~~~~~~~~~~~~~~~~~~~~
         939:  .lds_size: 0 
next:83'0     ~~~~~~~~~~~~~~
           .
           .
...

@llvm-ci
Copy link
Collaborator

llvm-ci commented Jun 24, 2025

LLVM Buildbot has detected a new failure on builder openmp-offload-amdgpu-runtime-2 running on rocm-worker-hw-02 while building llvm at step 8 "Add check check-llvm".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/10/builds/7922

Here is the relevant piece of the build log for the reference
Step 8 (Add check check-llvm) failure: test (failure)
******************** TEST 'LLVM :: CodeGen/AMDGPU/pal-metadata-3.0-callable-dvgpr.ll' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/bin/llc -mtriple=amdgcn--amdpal -mcpu=gfx1200 -verify-machineinstrs < /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/llvm/test/CodeGen/AMDGPU/pal-metadata-3.0-callable-dvgpr.ll | /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/bin/FileCheck /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/llvm/test/CodeGen/AMDGPU/pal-metadata-3.0-callable-dvgpr.ll # RUN: at line 1
+ /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/bin/llc -mtriple=amdgcn--amdpal -mcpu=gfx1200 -verify-machineinstrs
+ /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/bin/FileCheck /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/llvm/test/CodeGen/AMDGPU/pal-metadata-3.0-callable-dvgpr.ll
/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/llvm/test/CodeGen/AMDGPU/pal-metadata-3.0-callable-dvgpr.ll:83:15: error: CHECK-NEXT: expected string not found in input
; CHECK-NEXT: .sgpr_count: 0x1
              ^
<stdin>:933:14: note: scanning from here
 .lds_size: 0
             ^
<stdin>:934:2: note: possible intended match here
 .sgpr_count: 0x21
 ^

Input file: <stdin>
Check file: /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/llvm/test/CodeGen/AMDGPU/pal-metadata-3.0-callable-dvgpr.ll

-dump-input=help explains the following input dump.

Input was:
<<<<<<
           .
           .
           .
         928:  .sgpr_count: 0x22 
         929:  .stack_frame_size_in_bytes: 0x10 
         930:  .vgpr_count: 0x3 
         931:  multiple_stack: 
         932:  .backend_stack_size: 0x24 
         933:  .lds_size: 0 
next:83'0                  X error: no match found
         934:  .sgpr_count: 0x21 
next:83'0     ~~~~~~~~~~~~~~~~~~~
next:83'1      ?                  possible intended match
         935:  .stack_frame_size_in_bytes: 0x24 
next:83'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         936:  .vgpr_count: 0x3 
next:83'0     ~~~~~~~~~~~~~~~~~~
         937:  no_stack: 
next:83'0     ~~~~~~~~~~~
         938:  .backend_stack_size: 0 
next:83'0     ~~~~~~~~~~~~~~~~~~~~~~~~
         939:  .lds_size: 0 
next:83'0     ~~~~~~~~~~~~~~
           .
           .
...

@llvm-ci
Copy link
Collaborator

llvm-ci commented Jun 24, 2025

LLVM Buildbot has detected a new failure on builder clang-x86_64-debian-fast running on gribozavr4 while building llvm at step 6 "test-build-unified-tree-check-all".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/56/builds/29138

Here is the relevant piece of the build log for the reference
Step 6 (test-build-unified-tree-check-all) failure: test (failure)
******************** TEST 'LLVM :: CodeGen/AMDGPU/pal-metadata-3.0-callable-dvgpr.ll' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
/b/1/clang-x86_64-debian-fast/llvm.obj/bin/llc -mtriple=amdgcn--amdpal -mcpu=gfx1200 -verify-machineinstrs < /b/1/clang-x86_64-debian-fast/llvm.src/llvm/test/CodeGen/AMDGPU/pal-metadata-3.0-callable-dvgpr.ll | /b/1/clang-x86_64-debian-fast/llvm.obj/bin/FileCheck /b/1/clang-x86_64-debian-fast/llvm.src/llvm/test/CodeGen/AMDGPU/pal-metadata-3.0-callable-dvgpr.ll # RUN: at line 1
+ /b/1/clang-x86_64-debian-fast/llvm.obj/bin/llc -mtriple=amdgcn--amdpal -mcpu=gfx1200 -verify-machineinstrs
+ /b/1/clang-x86_64-debian-fast/llvm.obj/bin/FileCheck /b/1/clang-x86_64-debian-fast/llvm.src/llvm/test/CodeGen/AMDGPU/pal-metadata-3.0-callable-dvgpr.ll
/b/1/clang-x86_64-debian-fast/llvm.src/llvm/test/CodeGen/AMDGPU/pal-metadata-3.0-callable-dvgpr.ll:83:15: error: CHECK-NEXT: expected string not found in input
; CHECK-NEXT: .sgpr_count: 0x1
              ^
<stdin>:933:14: note: scanning from here
 .lds_size: 0
             ^
<stdin>:934:2: note: possible intended match here
 .sgpr_count: 0x21
 ^

Input file: <stdin>
Check file: /b/1/clang-x86_64-debian-fast/llvm.src/llvm/test/CodeGen/AMDGPU/pal-metadata-3.0-callable-dvgpr.ll

-dump-input=help explains the following input dump.

Input was:
<<<<<<
           .
           .
           .
         928:  .sgpr_count: 0x22 
         929:  .stack_frame_size_in_bytes: 0x10 
         930:  .vgpr_count: 0x3 
         931:  multiple_stack: 
         932:  .backend_stack_size: 0x24 
         933:  .lds_size: 0 
next:83'0                  X error: no match found
         934:  .sgpr_count: 0x21 
next:83'0     ~~~~~~~~~~~~~~~~~~~
next:83'1      ?                  possible intended match
         935:  .stack_frame_size_in_bytes: 0x24 
next:83'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         936:  .vgpr_count: 0x3 
next:83'0     ~~~~~~~~~~~~~~~~~~
         937:  no_stack: 
next:83'0     ~~~~~~~~~~~
         938:  .backend_stack_size: 0 
next:83'0     ~~~~~~~~~~~~~~~~~~~~~~~~
         939:  .lds_size: 0 
next:83'0     ~~~~~~~~~~~~~~
           .
           .
...

@llvm-ci
Copy link
Collaborator

llvm-ci commented Jun 24, 2025

LLVM Buildbot has detected a new failure on builder ml-opt-devrel-x86-64 running on ml-opt-devrel-x86-64-b1 while building llvm at step 6 "test-build-unified-tree-check-all".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/175/builds/20838

Here is the relevant piece of the build log for the reference
Step 6 (test-build-unified-tree-check-all) failure: test (failure)
******************** TEST 'LLVM :: CodeGen/AMDGPU/pal-metadata-3.0-callable-dvgpr.ll' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
/b/ml-opt-devrel-x86-64-b1/build/bin/llc -mtriple=amdgcn--amdpal -mcpu=gfx1200 -verify-machineinstrs < /b/ml-opt-devrel-x86-64-b1/llvm-project/llvm/test/CodeGen/AMDGPU/pal-metadata-3.0-callable-dvgpr.ll | /b/ml-opt-devrel-x86-64-b1/build/bin/FileCheck /b/ml-opt-devrel-x86-64-b1/llvm-project/llvm/test/CodeGen/AMDGPU/pal-metadata-3.0-callable-dvgpr.ll # RUN: at line 1
+ /b/ml-opt-devrel-x86-64-b1/build/bin/FileCheck /b/ml-opt-devrel-x86-64-b1/llvm-project/llvm/test/CodeGen/AMDGPU/pal-metadata-3.0-callable-dvgpr.ll
+ /b/ml-opt-devrel-x86-64-b1/build/bin/llc -mtriple=amdgcn--amdpal -mcpu=gfx1200 -verify-machineinstrs
/b/ml-opt-devrel-x86-64-b1/llvm-project/llvm/test/CodeGen/AMDGPU/pal-metadata-3.0-callable-dvgpr.ll:83:15: error: CHECK-NEXT: expected string not found in input
; CHECK-NEXT: .sgpr_count: 0x1
              ^
<stdin>:933:14: note: scanning from here
 .lds_size: 0
             ^
<stdin>:934:2: note: possible intended match here
 .sgpr_count: 0x21
 ^

Input file: <stdin>
Check file: /b/ml-opt-devrel-x86-64-b1/llvm-project/llvm/test/CodeGen/AMDGPU/pal-metadata-3.0-callable-dvgpr.ll

-dump-input=help explains the following input dump.

Input was:
<<<<<<
           .
           .
           .
         928:  .sgpr_count: 0x22 
         929:  .stack_frame_size_in_bytes: 0x10 
         930:  .vgpr_count: 0x3 
         931:  multiple_stack: 
         932:  .backend_stack_size: 0x24 
         933:  .lds_size: 0 
next:83'0                  X error: no match found
         934:  .sgpr_count: 0x21 
next:83'0     ~~~~~~~~~~~~~~~~~~~
next:83'1      ?                  possible intended match
         935:  .stack_frame_size_in_bytes: 0x24 
next:83'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         936:  .vgpr_count: 0x3 
next:83'0     ~~~~~~~~~~~~~~~~~~
         937:  no_stack: 
next:83'0     ~~~~~~~~~~~
         938:  .backend_stack_size: 0 
next:83'0     ~~~~~~~~~~~~~~~~~~~~~~~~
         939:  .lds_size: 0 
next:83'0     ~~~~~~~~~~~~~~
           .
           .
...

@llvm-ci
Copy link
Collaborator

llvm-ci commented Jun 24, 2025

LLVM Buildbot has detected a new failure on builder ml-opt-dev-x86-64 running on ml-opt-dev-x86-64-b1 while building llvm at step 6 "test-build-unified-tree-check-all".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/137/builds/20895

Here is the relevant piece of the build log for the reference
Step 6 (test-build-unified-tree-check-all) failure: test (failure)
******************** TEST 'LLVM :: CodeGen/AMDGPU/pal-metadata-3.0-callable-dvgpr.ll' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
/b/ml-opt-dev-x86-64-b1/build/bin/llc -mtriple=amdgcn--amdpal -mcpu=gfx1200 -verify-machineinstrs < /b/ml-opt-dev-x86-64-b1/llvm-project/llvm/test/CodeGen/AMDGPU/pal-metadata-3.0-callable-dvgpr.ll | /b/ml-opt-dev-x86-64-b1/build/bin/FileCheck /b/ml-opt-dev-x86-64-b1/llvm-project/llvm/test/CodeGen/AMDGPU/pal-metadata-3.0-callable-dvgpr.ll # RUN: at line 1
+ /b/ml-opt-dev-x86-64-b1/build/bin/llc -mtriple=amdgcn--amdpal -mcpu=gfx1200 -verify-machineinstrs
+ /b/ml-opt-dev-x86-64-b1/build/bin/FileCheck /b/ml-opt-dev-x86-64-b1/llvm-project/llvm/test/CodeGen/AMDGPU/pal-metadata-3.0-callable-dvgpr.ll
/b/ml-opt-dev-x86-64-b1/llvm-project/llvm/test/CodeGen/AMDGPU/pal-metadata-3.0-callable-dvgpr.ll:83:15: error: CHECK-NEXT: expected string not found in input
; CHECK-NEXT: .sgpr_count: 0x1
              ^
<stdin>:933:14: note: scanning from here
 .lds_size: 0
             ^
<stdin>:934:2: note: possible intended match here
 .sgpr_count: 0x21
 ^

Input file: <stdin>
Check file: /b/ml-opt-dev-x86-64-b1/llvm-project/llvm/test/CodeGen/AMDGPU/pal-metadata-3.0-callable-dvgpr.ll

-dump-input=help explains the following input dump.

Input was:
<<<<<<
           .
           .
           .
         928:  .sgpr_count: 0x22 
         929:  .stack_frame_size_in_bytes: 0x10 
         930:  .vgpr_count: 0x3 
         931:  multiple_stack: 
         932:  .backend_stack_size: 0x24 
         933:  .lds_size: 0 
next:83'0                  X error: no match found
         934:  .sgpr_count: 0x21 
next:83'0     ~~~~~~~~~~~~~~~~~~~
next:83'1      ?                  possible intended match
         935:  .stack_frame_size_in_bytes: 0x24 
next:83'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         936:  .vgpr_count: 0x3 
next:83'0     ~~~~~~~~~~~~~~~~~~
         937:  no_stack: 
next:83'0     ~~~~~~~~~~~
         938:  .backend_stack_size: 0 
next:83'0     ~~~~~~~~~~~~~~~~~~~~~~~~
         939:  .lds_size: 0 
next:83'0     ~~~~~~~~~~~~~~
           .
           .
...

@llvm-ci
Copy link
Collaborator

llvm-ci commented Jun 24, 2025

LLVM Buildbot has detected a new failure on builder premerge-monolithic-linux running on premerge-linux-1 while building llvm at step 7 "test-build-unified-tree-check-all".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/153/builds/35731

Here is the relevant piece of the build log for the reference
Step 7 (test-build-unified-tree-check-all) failure: test (failure)
******************** TEST 'LLVM :: CodeGen/AMDGPU/pal-metadata-3.0-callable-dvgpr.ll' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
/build/buildbot/premerge-monolithic-linux/build/bin/llc -mtriple=amdgcn--amdpal -mcpu=gfx1200 -verify-machineinstrs < /build/buildbot/premerge-monolithic-linux/llvm-project/llvm/test/CodeGen/AMDGPU/pal-metadata-3.0-callable-dvgpr.ll | /build/buildbot/premerge-monolithic-linux/build/bin/FileCheck /build/buildbot/premerge-monolithic-linux/llvm-project/llvm/test/CodeGen/AMDGPU/pal-metadata-3.0-callable-dvgpr.ll # RUN: at line 1
+ /build/buildbot/premerge-monolithic-linux/build/bin/llc -mtriple=amdgcn--amdpal -mcpu=gfx1200 -verify-machineinstrs
+ /build/buildbot/premerge-monolithic-linux/build/bin/FileCheck /build/buildbot/premerge-monolithic-linux/llvm-project/llvm/test/CodeGen/AMDGPU/pal-metadata-3.0-callable-dvgpr.ll
/build/buildbot/premerge-monolithic-linux/llvm-project/llvm/test/CodeGen/AMDGPU/pal-metadata-3.0-callable-dvgpr.ll:83:15: error: CHECK-NEXT: expected string not found in input
; CHECK-NEXT: .sgpr_count: 0x1
              ^
<stdin>:933:14: note: scanning from here
 .lds_size: 0
             ^
<stdin>:934:2: note: possible intended match here
 .sgpr_count: 0x21
 ^

Input file: <stdin>
Check file: /build/buildbot/premerge-monolithic-linux/llvm-project/llvm/test/CodeGen/AMDGPU/pal-metadata-3.0-callable-dvgpr.ll

-dump-input=help explains the following input dump.

Input was:
<<<<<<
           .
           .
           .
         928:  .sgpr_count: 0x22 
         929:  .stack_frame_size_in_bytes: 0x10 
         930:  .vgpr_count: 0x3 
         931:  multiple_stack: 
         932:  .backend_stack_size: 0x24 
         933:  .lds_size: 0 
next:83'0                  X error: no match found
         934:  .sgpr_count: 0x21 
next:83'0     ~~~~~~~~~~~~~~~~~~~
next:83'1      ?                  possible intended match
         935:  .stack_frame_size_in_bytes: 0x24 
next:83'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         936:  .vgpr_count: 0x3 
next:83'0     ~~~~~~~~~~~~~~~~~~
         937:  no_stack: 
next:83'0     ~~~~~~~~~~~
         938:  .backend_stack_size: 0 
next:83'0     ~~~~~~~~~~~~~~~~~~~~~~~~
         939:  .lds_size: 0 
next:83'0     ~~~~~~~~~~~~~~
           .
           .
...

@llvm-ci
Copy link
Collaborator

llvm-ci commented Jun 24, 2025

LLVM Buildbot has detected a new failure on builder ml-opt-rel-x86-64 running on ml-opt-rel-x86-64-b2 while building llvm at step 6 "test-build-unified-tree-check-all".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/185/builds/20704

Here is the relevant piece of the build log for the reference
Step 6 (test-build-unified-tree-check-all) failure: test (failure)
******************** TEST 'LLVM :: CodeGen/AMDGPU/pal-metadata-3.0-callable-dvgpr.ll' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
/b/ml-opt-rel-x86-64-b1/build/bin/llc -mtriple=amdgcn--amdpal -mcpu=gfx1200 -verify-machineinstrs < /b/ml-opt-rel-x86-64-b1/llvm-project/llvm/test/CodeGen/AMDGPU/pal-metadata-3.0-callable-dvgpr.ll | /b/ml-opt-rel-x86-64-b1/build/bin/FileCheck /b/ml-opt-rel-x86-64-b1/llvm-project/llvm/test/CodeGen/AMDGPU/pal-metadata-3.0-callable-dvgpr.ll # RUN: at line 1
+ /b/ml-opt-rel-x86-64-b1/build/bin/llc -mtriple=amdgcn--amdpal -mcpu=gfx1200 -verify-machineinstrs
+ /b/ml-opt-rel-x86-64-b1/build/bin/FileCheck /b/ml-opt-rel-x86-64-b1/llvm-project/llvm/test/CodeGen/AMDGPU/pal-metadata-3.0-callable-dvgpr.ll
/b/ml-opt-rel-x86-64-b1/llvm-project/llvm/test/CodeGen/AMDGPU/pal-metadata-3.0-callable-dvgpr.ll:83:15: error: CHECK-NEXT: expected string not found in input
; CHECK-NEXT: .sgpr_count: 0x1
              ^
<stdin>:933:14: note: scanning from here
 .lds_size: 0
             ^
<stdin>:934:2: note: possible intended match here
 .sgpr_count: 0x21
 ^

Input file: <stdin>
Check file: /b/ml-opt-rel-x86-64-b1/llvm-project/llvm/test/CodeGen/AMDGPU/pal-metadata-3.0-callable-dvgpr.ll

-dump-input=help explains the following input dump.

Input was:
<<<<<<
           .
           .
           .
         928:  .sgpr_count: 0x22 
         929:  .stack_frame_size_in_bytes: 0x10 
         930:  .vgpr_count: 0x3 
         931:  multiple_stack: 
         932:  .backend_stack_size: 0x24 
         933:  .lds_size: 0 
next:83'0                  X error: no match found
         934:  .sgpr_count: 0x21 
next:83'0     ~~~~~~~~~~~~~~~~~~~
next:83'1      ?                  possible intended match
         935:  .stack_frame_size_in_bytes: 0x24 
next:83'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         936:  .vgpr_count: 0x3 
next:83'0     ~~~~~~~~~~~~~~~~~~
         937:  no_stack: 
next:83'0     ~~~~~~~~~~~
         938:  .backend_stack_size: 0 
next:83'0     ~~~~~~~~~~~~~~~~~~~~~~~~
         939:  .lds_size: 0 
next:83'0     ~~~~~~~~~~~~~~
           .
           .
...

@rovka
Copy link
Collaborator Author

rovka commented Jun 24, 2025

Oops, looks like I forgot to update the branch... I'll send a fix.

@llvm-ci
Copy link
Collaborator

llvm-ci commented Jun 24, 2025

LLVM Buildbot has detected a new failure on builder openmp-offload-sles-build-only running on rocm-worker-hw-04-sles while building llvm at step 9 "Add check check-llvm".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/140/builds/25592

Here is the relevant piece of the build log for the reference
Step 9 (Add check check-llvm) failure: test (failure)
******************** TEST 'LLVM :: CodeGen/AMDGPU/pal-metadata-3.0-callable-dvgpr.ll' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
/home/botworker/bbot/builds/openmp-offload-sles-build/llvm.build/bin/llc -mtriple=amdgcn--amdpal -mcpu=gfx1200 -verify-machineinstrs < /home/botworker/bbot/builds/openmp-offload-sles-build/llvm.src/llvm/test/CodeGen/AMDGPU/pal-metadata-3.0-callable-dvgpr.ll | /home/botworker/bbot/builds/openmp-offload-sles-build/llvm.build/bin/FileCheck /home/botworker/bbot/builds/openmp-offload-sles-build/llvm.src/llvm/test/CodeGen/AMDGPU/pal-metadata-3.0-callable-dvgpr.ll # RUN: at line 1
+ /home/botworker/bbot/builds/openmp-offload-sles-build/llvm.build/bin/llc -mtriple=amdgcn--amdpal -mcpu=gfx1200 -verify-machineinstrs
+ /home/botworker/bbot/builds/openmp-offload-sles-build/llvm.build/bin/FileCheck /home/botworker/bbot/builds/openmp-offload-sles-build/llvm.src/llvm/test/CodeGen/AMDGPU/pal-metadata-3.0-callable-dvgpr.ll
/home/botworker/bbot/builds/openmp-offload-sles-build/llvm.src/llvm/test/CodeGen/AMDGPU/pal-metadata-3.0-callable-dvgpr.ll:83:15: error: CHECK-NEXT: expected string not found in input
; CHECK-NEXT: .sgpr_count: 0x1
              ^
<stdin>:933:14: note: scanning from here
 .lds_size: 0
             ^
<stdin>:934:2: note: possible intended match here
 .sgpr_count: 0x21
 ^

Input file: <stdin>
Check file: /home/botworker/bbot/builds/openmp-offload-sles-build/llvm.src/llvm/test/CodeGen/AMDGPU/pal-metadata-3.0-callable-dvgpr.ll

-dump-input=help explains the following input dump.

Input was:
<<<<<<
           .
           .
           .
         928:  .sgpr_count: 0x22 
         929:  .stack_frame_size_in_bytes: 0x10 
         930:  .vgpr_count: 0x3 
         931:  multiple_stack: 
         932:  .backend_stack_size: 0x24 
         933:  .lds_size: 0 
next:83'0                  X error: no match found
         934:  .sgpr_count: 0x21 
next:83'0     ~~~~~~~~~~~~~~~~~~~
next:83'1      ?                  possible intended match
         935:  .stack_frame_size_in_bytes: 0x24 
next:83'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         936:  .vgpr_count: 0x3 
next:83'0     ~~~~~~~~~~~~~~~~~~
         937:  no_stack: 
next:83'0     ~~~~~~~~~~~
         938:  .backend_stack_size: 0 
next:83'0     ~~~~~~~~~~~~~~~~~~~~~~~~
         939:  .lds_size: 0 
next:83'0     ~~~~~~~~~~~~~~
           .
           .
...

@llvm-ci
Copy link
Collaborator

llvm-ci commented Jun 24, 2025

LLVM Buildbot has detected a new failure on builder lld-x86_64-ubuntu-fast running on as-builder-4 while building llvm at step 6 "test-build-unified-tree-check-all".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/33/builds/18831

Here is the relevant piece of the build log for the reference
Step 6 (test-build-unified-tree-check-all) failure: test (failure)
******************** TEST 'LLVM :: CodeGen/AMDGPU/pal-metadata-3.0-callable-dvgpr.ll' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
/home/buildbot/worker/as-builder-4/ramdisk/lld-x86_64/build/bin/llc -mtriple=amdgcn--amdpal -mcpu=gfx1200 -verify-machineinstrs < /home/buildbot/worker/as-builder-4/ramdisk/lld-x86_64/llvm-project/llvm/test/CodeGen/AMDGPU/pal-metadata-3.0-callable-dvgpr.ll | /home/buildbot/worker/as-builder-4/ramdisk/lld-x86_64/build/bin/FileCheck /home/buildbot/worker/as-builder-4/ramdisk/lld-x86_64/llvm-project/llvm/test/CodeGen/AMDGPU/pal-metadata-3.0-callable-dvgpr.ll # RUN: at line 1
+ /home/buildbot/worker/as-builder-4/ramdisk/lld-x86_64/build/bin/llc -mtriple=amdgcn--amdpal -mcpu=gfx1200 -verify-machineinstrs
+ /home/buildbot/worker/as-builder-4/ramdisk/lld-x86_64/build/bin/FileCheck /home/buildbot/worker/as-builder-4/ramdisk/lld-x86_64/llvm-project/llvm/test/CodeGen/AMDGPU/pal-metadata-3.0-callable-dvgpr.ll
/home/buildbot/worker/as-builder-4/ramdisk/lld-x86_64/llvm-project/llvm/test/CodeGen/AMDGPU/pal-metadata-3.0-callable-dvgpr.ll:83:15: error: CHECK-NEXT: expected string not found in input
; CHECK-NEXT: .sgpr_count: 0x1
              ^
<stdin>:933:14: note: scanning from here
 .lds_size: 0
             ^
<stdin>:934:2: note: possible intended match here
 .sgpr_count: 0x21
 ^

Input file: <stdin>
Check file: /home/buildbot/worker/as-builder-4/ramdisk/lld-x86_64/llvm-project/llvm/test/CodeGen/AMDGPU/pal-metadata-3.0-callable-dvgpr.ll

-dump-input=help explains the following input dump.

Input was:
<<<<<<
           .
           .
           .
         928:  .sgpr_count: 0x22 
         929:  .stack_frame_size_in_bytes: 0x10 
         930:  .vgpr_count: 0x3 
         931:  multiple_stack: 
         932:  .backend_stack_size: 0x24 
         933:  .lds_size: 0 
next:83'0                  X error: no match found
         934:  .sgpr_count: 0x21 
next:83'0     ~~~~~~~~~~~~~~~~~~~
next:83'1      ?                  possible intended match
         935:  .stack_frame_size_in_bytes: 0x24 
next:83'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         936:  .vgpr_count: 0x3 
next:83'0     ~~~~~~~~~~~~~~~~~~
         937:  no_stack: 
next:83'0     ~~~~~~~~~~~
         938:  .backend_stack_size: 0 
next:83'0     ~~~~~~~~~~~~~~~~~~~~~~~~
         939:  .lds_size: 0 
next:83'0     ~~~~~~~~~~~~~~
           .
           .
...

@llvm-ci
Copy link
Collaborator

llvm-ci commented Jun 24, 2025

LLVM Buildbot has detected a new failure on builder llvm-x86_64-debian-dylib running on gribozavr4 while building llvm at step 7 "test-build-unified-tree-check-llvm".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/60/builds/31027

Here is the relevant piece of the build log for the reference
Step 7 (test-build-unified-tree-check-llvm) failure: test (failure)
******************** TEST 'LLVM :: CodeGen/AMDGPU/pal-metadata-3.0-callable-dvgpr.ll' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
/b/1/llvm-x86_64-debian-dylib/build/bin/llc -mtriple=amdgcn--amdpal -mcpu=gfx1200 -verify-machineinstrs < /b/1/llvm-x86_64-debian-dylib/llvm-project/llvm/test/CodeGen/AMDGPU/pal-metadata-3.0-callable-dvgpr.ll | /b/1/llvm-x86_64-debian-dylib/build/bin/FileCheck /b/1/llvm-x86_64-debian-dylib/llvm-project/llvm/test/CodeGen/AMDGPU/pal-metadata-3.0-callable-dvgpr.ll # RUN: at line 1
+ /b/1/llvm-x86_64-debian-dylib/build/bin/FileCheck /b/1/llvm-x86_64-debian-dylib/llvm-project/llvm/test/CodeGen/AMDGPU/pal-metadata-3.0-callable-dvgpr.ll
+ /b/1/llvm-x86_64-debian-dylib/build/bin/llc -mtriple=amdgcn--amdpal -mcpu=gfx1200 -verify-machineinstrs
/b/1/llvm-x86_64-debian-dylib/llvm-project/llvm/test/CodeGen/AMDGPU/pal-metadata-3.0-callable-dvgpr.ll:83:15: error: CHECK-NEXT: expected string not found in input
; CHECK-NEXT: .sgpr_count: 0x1
              ^
<stdin>:933:14: note: scanning from here
 .lds_size: 0
             ^
<stdin>:934:2: note: possible intended match here
 .sgpr_count: 0x21
 ^

Input file: <stdin>
Check file: /b/1/llvm-x86_64-debian-dylib/llvm-project/llvm/test/CodeGen/AMDGPU/pal-metadata-3.0-callable-dvgpr.ll

-dump-input=help explains the following input dump.

Input was:
<<<<<<
           .
           .
           .
         928:  .sgpr_count: 0x22 
         929:  .stack_frame_size_in_bytes: 0x10 
         930:  .vgpr_count: 0x3 
         931:  multiple_stack: 
         932:  .backend_stack_size: 0x24 
         933:  .lds_size: 0 
next:83'0                  X error: no match found
         934:  .sgpr_count: 0x21 
next:83'0     ~~~~~~~~~~~~~~~~~~~
next:83'1      ?                  possible intended match
         935:  .stack_frame_size_in_bytes: 0x24 
next:83'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         936:  .vgpr_count: 0x3 
next:83'0     ~~~~~~~~~~~~~~~~~~
         937:  no_stack: 
next:83'0     ~~~~~~~~~~~
         938:  .backend_stack_size: 0 
next:83'0     ~~~~~~~~~~~~~~~~~~~~~~~~
         939:  .lds_size: 0 
next:83'0     ~~~~~~~~~~~~~~
           .
           .
...

@llvm-ci
Copy link
Collaborator

llvm-ci commented Jun 24, 2025

LLVM Buildbot has detected a new failure on builder llvm-clang-x86_64-expensive-checks-debian running on gribozavr4 while building llvm at step 6 "test-build-unified-tree-check-all".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/16/builds/21368

Here is the relevant piece of the build log for the reference
Step 6 (test-build-unified-tree-check-all) failure: test (failure)
******************** TEST 'LLVM :: CodeGen/AMDGPU/pal-metadata-3.0-callable-dvgpr.ll' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
/b/1/llvm-clang-x86_64-expensive-checks-debian/build/bin/llc -mtriple=amdgcn--amdpal -mcpu=gfx1200 -verify-machineinstrs < /b/1/llvm-clang-x86_64-expensive-checks-debian/llvm-project/llvm/test/CodeGen/AMDGPU/pal-metadata-3.0-callable-dvgpr.ll | /b/1/llvm-clang-x86_64-expensive-checks-debian/build/bin/FileCheck /b/1/llvm-clang-x86_64-expensive-checks-debian/llvm-project/llvm/test/CodeGen/AMDGPU/pal-metadata-3.0-callable-dvgpr.ll # RUN: at line 1
+ /b/1/llvm-clang-x86_64-expensive-checks-debian/build/bin/FileCheck /b/1/llvm-clang-x86_64-expensive-checks-debian/llvm-project/llvm/test/CodeGen/AMDGPU/pal-metadata-3.0-callable-dvgpr.ll
+ /b/1/llvm-clang-x86_64-expensive-checks-debian/build/bin/llc -mtriple=amdgcn--amdpal -mcpu=gfx1200 -verify-machineinstrs
/b/1/llvm-clang-x86_64-expensive-checks-debian/llvm-project/llvm/test/CodeGen/AMDGPU/pal-metadata-3.0-callable-dvgpr.ll:83:15: error: CHECK-NEXT: expected string not found in input
; CHECK-NEXT: .sgpr_count: 0x1
              ^
<stdin>:933:14: note: scanning from here
 .lds_size: 0
             ^
<stdin>:934:2: note: possible intended match here
 .sgpr_count: 0x21
 ^

Input file: <stdin>
Check file: /b/1/llvm-clang-x86_64-expensive-checks-debian/llvm-project/llvm/test/CodeGen/AMDGPU/pal-metadata-3.0-callable-dvgpr.ll

-dump-input=help explains the following input dump.

Input was:
<<<<<<
           .
           .
           .
         928:  .sgpr_count: 0x22 
         929:  .stack_frame_size_in_bytes: 0x10 
         930:  .vgpr_count: 0x3 
         931:  multiple_stack: 
         932:  .backend_stack_size: 0x24 
         933:  .lds_size: 0 
next:83'0                  X error: no match found
         934:  .sgpr_count: 0x21 
next:83'0     ~~~~~~~~~~~~~~~~~~~
next:83'1      ?                  possible intended match
         935:  .stack_frame_size_in_bytes: 0x24 
next:83'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         936:  .vgpr_count: 0x3 
next:83'0     ~~~~~~~~~~~~~~~~~~
         937:  no_stack: 
next:83'0     ~~~~~~~~~~~
         938:  .backend_stack_size: 0 
next:83'0     ~~~~~~~~~~~~~~~~~~~~~~~~
         939:  .lds_size: 0 
next:83'0     ~~~~~~~~~~~~~~
           .
           .
...

@llvm-ci
Copy link
Collaborator

llvm-ci commented Jun 24, 2025

LLVM Buildbot has detected a new failure on builder llvm-clang-x86_64-gcc-ubuntu running on sie-linux-worker3 while building llvm at step 6 "test-build-unified-tree-check-all".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/174/builds/19892

Here is the relevant piece of the build log for the reference
Step 6 (test-build-unified-tree-check-all) failure: test (failure)
******************** TEST 'LLVM :: CodeGen/AMDGPU/pal-metadata-3.0-callable-dvgpr.ll' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
/home/buildbot/buildbot-root/llvm-clang-x86_64-gcc-ubuntu/build/bin/llc -mtriple=amdgcn--amdpal -mcpu=gfx1200 -verify-machineinstrs < /home/buildbot/buildbot-root/llvm-clang-x86_64-gcc-ubuntu/llvm-project/llvm/test/CodeGen/AMDGPU/pal-metadata-3.0-callable-dvgpr.ll | /home/buildbot/buildbot-root/llvm-clang-x86_64-gcc-ubuntu/build/bin/FileCheck /home/buildbot/buildbot-root/llvm-clang-x86_64-gcc-ubuntu/llvm-project/llvm/test/CodeGen/AMDGPU/pal-metadata-3.0-callable-dvgpr.ll # RUN: at line 1
+ /home/buildbot/buildbot-root/llvm-clang-x86_64-gcc-ubuntu/build/bin/llc -mtriple=amdgcn--amdpal -mcpu=gfx1200 -verify-machineinstrs
+ /home/buildbot/buildbot-root/llvm-clang-x86_64-gcc-ubuntu/build/bin/FileCheck /home/buildbot/buildbot-root/llvm-clang-x86_64-gcc-ubuntu/llvm-project/llvm/test/CodeGen/AMDGPU/pal-metadata-3.0-callable-dvgpr.ll
�[1m/home/buildbot/buildbot-root/llvm-clang-x86_64-gcc-ubuntu/llvm-project/llvm/test/CodeGen/AMDGPU/pal-metadata-3.0-callable-dvgpr.ll:83:15: �[0m�[0;1;31merror: �[0m�[1mCHECK-NEXT: expected string not found in input
�[0m; CHECK-NEXT: .sgpr_count: 0x1
�[0;1;32m              ^
�[0m�[1m<stdin>:933:14: �[0m�[0;1;30mnote: �[0m�[1mscanning from here
�[0m .lds_size: 0
�[0;1;32m             ^
�[0m�[1m<stdin>:934:2: �[0m�[0;1;30mnote: �[0m�[1mpossible intended match here
�[0m .sgpr_count: 0x21
�[0;1;32m ^
�[0m
Input file: <stdin>
Check file: /home/buildbot/buildbot-root/llvm-clang-x86_64-gcc-ubuntu/llvm-project/llvm/test/CodeGen/AMDGPU/pal-metadata-3.0-callable-dvgpr.ll

-dump-input=help explains the following input dump.

Input was:
<<<<<<
�[1m�[0m�[0;1;30m           1: �[0m�[1m�[0;1;46m .amdgcn_target "amdgcn-unknown-amdpal--gfx1200" �[0m
�[0;1;30m           2: �[0m�[1m�[0;1;46m .text �[0m
�[0;1;30m           3: �[0m�[1m�[0;1;46m .globl no_stack ; -- Begin function no_stack �[0m
�[0;1;30m           4: �[0m�[1m�[0;1;46m .p2align 2 �[0m
�[0;1;30m           5: �[0m�[1m�[0;1;46m .type no_stack,@function �[0m
�[0;1;30m           6: �[0m�[1m�[0;1;46mno_stack: ; @no_stack �[0m
�[0;1;30m           7: �[0m�[1m�[0;1;46m; %bb.0: �[0m
�[0;1;30m           8: �[0m�[1m�[0;1;46m s_wait_loadcnt_dscnt 0x0 �[0m
�[0;1;30m           9: �[0m�[1m�[0;1;46m s_wait_expcnt 0x0 �[0m
�[0;1;30m          10: �[0m�[1m�[0;1;46m s_wait_samplecnt 0x0 �[0m
�[0;1;30m          11: �[0m�[1m�[0;1;46m s_wait_bvhcnt 0x0 �[0m
�[0;1;30m          12: �[0m�[1m�[0;1;46m s_wait_kmcnt 0x0 �[0m
�[0;1;30m          13: �[0m�[1m�[0;1;46m v_add_f32_e32 v0, 1.0, v0 �[0m
�[0;1;30m          14: �[0m�[1m�[0;1;46m s_setpc_b64 s[30:31] �[0m
�[0;1;30m          15: �[0m�[1m�[0;1;46m.Lfunc_end0: �[0m
�[0;1;30m          16: �[0m�[1m�[0;1;46m .size no_stack, .Lfunc_end0-no_stack �[0m
�[0;1;30m          17: �[0m�[1m�[0;1;46m ; -- End function �[0m
�[0;1;30m          18: �[0m�[1m�[0;1;46m .set no_stack.num_vgpr, 1 �[0m
�[0;1;30m          19: �[0m�[1m�[0;1;46m .set no_stack.num_agpr, 0 �[0m
�[0;1;30m          20: �[0m�[1m�[0;1;46m .set no_stack.numbered_sgpr, 32 �[0m
�[0;1;30m          21: �[0m�[1m�[0;1;46m .set no_stack.private_seg_size, 0 �[0m
�[0;1;30m          22: �[0m�[1m�[0;1;46m .set no_stack.uses_vcc, 0 �[0m
�[0;1;30m          23: �[0m�[1m�[0;1;46m .set no_stack.uses_flat_scratch, 0 �[0m
�[0;1;30m          24: �[0m�[1m�[0;1;46m .set no_stack.has_dyn_sized_stack, 0 �[0m
�[0;1;30m          25: �[0m�[1m�[0;1;46m .set no_stack.has_recursion, 0 �[0m
...

@llvm-ci
Copy link
Collaborator

llvm-ci commented Jun 24, 2025

LLVM Buildbot has detected a new failure on builder clang-debian-cpp20 running on clang-debian-cpp20 while building llvm at step 6 "test-build-unified-tree-check-all".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/108/builds/14433

Here is the relevant piece of the build log for the reference
Step 6 (test-build-unified-tree-check-all) failure: test (failure)
******************** TEST 'LLVM :: CodeGen/AMDGPU/pal-metadata-3.0-callable-dvgpr.ll' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
/vol/worker/clang-debian-cpp20/clang-debian-cpp20/build/bin/llc -mtriple=amdgcn--amdpal -mcpu=gfx1200 -verify-machineinstrs < /vol/worker/clang-debian-cpp20/clang-debian-cpp20/llvm-project/llvm/test/CodeGen/AMDGPU/pal-metadata-3.0-callable-dvgpr.ll | /vol/worker/clang-debian-cpp20/clang-debian-cpp20/build/bin/FileCheck /vol/worker/clang-debian-cpp20/clang-debian-cpp20/llvm-project/llvm/test/CodeGen/AMDGPU/pal-metadata-3.0-callable-dvgpr.ll # RUN: at line 1
+ /vol/worker/clang-debian-cpp20/clang-debian-cpp20/build/bin/llc -mtriple=amdgcn--amdpal -mcpu=gfx1200 -verify-machineinstrs
+ /vol/worker/clang-debian-cpp20/clang-debian-cpp20/build/bin/FileCheck /vol/worker/clang-debian-cpp20/clang-debian-cpp20/llvm-project/llvm/test/CodeGen/AMDGPU/pal-metadata-3.0-callable-dvgpr.ll
/vol/worker/clang-debian-cpp20/clang-debian-cpp20/llvm-project/llvm/test/CodeGen/AMDGPU/pal-metadata-3.0-callable-dvgpr.ll:83:15: error: CHECK-NEXT: expected string not found in input
; CHECK-NEXT: .sgpr_count: 0x1
              ^
<stdin>:933:14: note: scanning from here
 .lds_size: 0
             ^
<stdin>:934:2: note: possible intended match here
 .sgpr_count: 0x21
 ^

Input file: <stdin>
Check file: /vol/worker/clang-debian-cpp20/clang-debian-cpp20/llvm-project/llvm/test/CodeGen/AMDGPU/pal-metadata-3.0-callable-dvgpr.ll

-dump-input=help explains the following input dump.

Input was:
<<<<<<
           .
           .
           .
         928:  .sgpr_count: 0x22 
         929:  .stack_frame_size_in_bytes: 0x10 
         930:  .vgpr_count: 0x3 
         931:  multiple_stack: 
         932:  .backend_stack_size: 0x24 
         933:  .lds_size: 0 
next:83'0                  X error: no match found
         934:  .sgpr_count: 0x21 
next:83'0     ~~~~~~~~~~~~~~~~~~~
next:83'1      ?                  possible intended match
         935:  .stack_frame_size_in_bytes: 0x24 
next:83'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         936:  .vgpr_count: 0x3 
next:83'0     ~~~~~~~~~~~~~~~~~~
         937:  no_stack: 
next:83'0     ~~~~~~~~~~~
         938:  .backend_stack_size: 0 
next:83'0     ~~~~~~~~~~~~~~~~~~~~~~~~
         939:  .lds_size: 0 
next:83'0     ~~~~~~~~~~~~~~
           .
           .
...

@llvm-ci
Copy link
Collaborator

llvm-ci commented Jun 24, 2025

LLVM Buildbot has detected a new failure on builder llvm-clang-key-instructions running on sie-linux-worker5 while building llvm at step 6 "test-build-unified-tree-check-all".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/208/builds/2239

Here is the relevant piece of the build log for the reference
Step 6 (test-build-unified-tree-check-all) failure: test (failure)
******************** TEST 'LLVM :: CodeGen/AMDGPU/pal-metadata-3.0-callable-dvgpr.ll' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
/home/buildbot/buildbot-root/llvm-ki/build/bin/llc -mtriple=amdgcn--amdpal -mcpu=gfx1200 -verify-machineinstrs < /home/buildbot/buildbot-root/llvm-ki/llvm-project/llvm/test/CodeGen/AMDGPU/pal-metadata-3.0-callable-dvgpr.ll | /home/buildbot/buildbot-root/llvm-ki/build/bin/FileCheck /home/buildbot/buildbot-root/llvm-ki/llvm-project/llvm/test/CodeGen/AMDGPU/pal-metadata-3.0-callable-dvgpr.ll # RUN: at line 1
+ /home/buildbot/buildbot-root/llvm-ki/build/bin/llc -mtriple=amdgcn--amdpal -mcpu=gfx1200 -verify-machineinstrs
+ /home/buildbot/buildbot-root/llvm-ki/build/bin/FileCheck /home/buildbot/buildbot-root/llvm-ki/llvm-project/llvm/test/CodeGen/AMDGPU/pal-metadata-3.0-callable-dvgpr.ll
�[1m/home/buildbot/buildbot-root/llvm-ki/llvm-project/llvm/test/CodeGen/AMDGPU/pal-metadata-3.0-callable-dvgpr.ll:83:15: �[0m�[0;1;31merror: �[0m�[1mCHECK-NEXT: expected string not found in input
�[0m; CHECK-NEXT: .sgpr_count: 0x1
�[0;1;32m              ^
�[0m�[1m<stdin>:933:14: �[0m�[0;1;30mnote: �[0m�[1mscanning from here
�[0m .lds_size: 0
�[0;1;32m             ^
�[0m�[1m<stdin>:934:2: �[0m�[0;1;30mnote: �[0m�[1mpossible intended match here
�[0m .sgpr_count: 0x21
�[0;1;32m ^
�[0m
Input file: <stdin>
Check file: /home/buildbot/buildbot-root/llvm-ki/llvm-project/llvm/test/CodeGen/AMDGPU/pal-metadata-3.0-callable-dvgpr.ll

-dump-input=help explains the following input dump.

Input was:
<<<<<<
�[1m�[0m�[0;1;30m           1: �[0m�[1m�[0;1;46m .amdgcn_target "amdgcn-unknown-amdpal--gfx1200" �[0m
�[0;1;30m           2: �[0m�[1m�[0;1;46m .text �[0m
�[0;1;30m           3: �[0m�[1m�[0;1;46m .globl no_stack ; -- Begin function no_stack �[0m
�[0;1;30m           4: �[0m�[1m�[0;1;46m .p2align 2 �[0m
�[0;1;30m           5: �[0m�[1m�[0;1;46m .type no_stack,@function �[0m
�[0;1;30m           6: �[0m�[1m�[0;1;46mno_stack: ; @no_stack �[0m
�[0;1;30m           7: �[0m�[1m�[0;1;46m; %bb.0: �[0m
�[0;1;30m           8: �[0m�[1m�[0;1;46m s_wait_loadcnt_dscnt 0x0 �[0m
�[0;1;30m           9: �[0m�[1m�[0;1;46m s_wait_expcnt 0x0 �[0m
�[0;1;30m          10: �[0m�[1m�[0;1;46m s_wait_samplecnt 0x0 �[0m
�[0;1;30m          11: �[0m�[1m�[0;1;46m s_wait_bvhcnt 0x0 �[0m
�[0;1;30m          12: �[0m�[1m�[0;1;46m s_wait_kmcnt 0x0 �[0m
�[0;1;30m          13: �[0m�[1m�[0;1;46m v_add_f32_e32 v0, 1.0, v0 �[0m
�[0;1;30m          14: �[0m�[1m�[0;1;46m s_setpc_b64 s[30:31] �[0m
�[0;1;30m          15: �[0m�[1m�[0;1;46m.Lfunc_end0: �[0m
�[0;1;30m          16: �[0m�[1m�[0;1;46m .size no_stack, .Lfunc_end0-no_stack �[0m
�[0;1;30m          17: �[0m�[1m�[0;1;46m ; -- End function �[0m
�[0;1;30m          18: �[0m�[1m�[0;1;46m .set no_stack.num_vgpr, 1 �[0m
�[0;1;30m          19: �[0m�[1m�[0;1;46m .set no_stack.num_agpr, 0 �[0m
�[0;1;30m          20: �[0m�[1m�[0;1;46m .set no_stack.numbered_sgpr, 32 �[0m
�[0;1;30m          21: �[0m�[1m�[0;1;46m .set no_stack.private_seg_size, 0 �[0m
�[0;1;30m          22: �[0m�[1m�[0;1;46m .set no_stack.uses_vcc, 0 �[0m
�[0;1;30m          23: �[0m�[1m�[0;1;46m .set no_stack.uses_flat_scratch, 0 �[0m
�[0;1;30m          24: �[0m�[1m�[0;1;46m .set no_stack.has_dyn_sized_stack, 0 �[0m
�[0;1;30m          25: �[0m�[1m�[0;1;46m .set no_stack.has_recursion, 0 �[0m
...

@llvm-ci
Copy link
Collaborator

llvm-ci commented Jun 24, 2025

LLVM Buildbot has detected a new failure on builder clang-aarch64-sve-vls-2stage running on linaro-g3-03 while building llvm at step 12 "ninja check 2".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/4/builds/7534

Here is the relevant piece of the build log for the reference
Step 12 (ninja check 2) failure: stage 2 checked (failure)
******************** TEST 'LLVM :: CodeGen/AMDGPU/pal-metadata-3.0-callable-dvgpr.ll' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
/home/tcwg-buildbot/worker/clang-aarch64-sve-vls-2stage/stage2/bin/llc -mtriple=amdgcn--amdpal -mcpu=gfx1200 -verify-machineinstrs < /home/tcwg-buildbot/worker/clang-aarch64-sve-vls-2stage/llvm/llvm/test/CodeGen/AMDGPU/pal-metadata-3.0-callable-dvgpr.ll | /home/tcwg-buildbot/worker/clang-aarch64-sve-vls-2stage/stage2/bin/FileCheck /home/tcwg-buildbot/worker/clang-aarch64-sve-vls-2stage/llvm/llvm/test/CodeGen/AMDGPU/pal-metadata-3.0-callable-dvgpr.ll # RUN: at line 1
+ /home/tcwg-buildbot/worker/clang-aarch64-sve-vls-2stage/stage2/bin/llc -mtriple=amdgcn--amdpal -mcpu=gfx1200 -verify-machineinstrs
+ /home/tcwg-buildbot/worker/clang-aarch64-sve-vls-2stage/stage2/bin/FileCheck /home/tcwg-buildbot/worker/clang-aarch64-sve-vls-2stage/llvm/llvm/test/CodeGen/AMDGPU/pal-metadata-3.0-callable-dvgpr.ll
/home/tcwg-buildbot/worker/clang-aarch64-sve-vls-2stage/llvm/llvm/test/CodeGen/AMDGPU/pal-metadata-3.0-callable-dvgpr.ll:83:15: error: CHECK-NEXT: expected string not found in input
; CHECK-NEXT: .sgpr_count: 0x1
              ^
<stdin>:933:14: note: scanning from here
 .lds_size: 0
             ^
<stdin>:934:2: note: possible intended match here
 .sgpr_count: 0x21
 ^

Input file: <stdin>
Check file: /home/tcwg-buildbot/worker/clang-aarch64-sve-vls-2stage/llvm/llvm/test/CodeGen/AMDGPU/pal-metadata-3.0-callable-dvgpr.ll

-dump-input=help explains the following input dump.

Input was:
<<<<<<
           .
           .
           .
         928:  .sgpr_count: 0x22 
         929:  .stack_frame_size_in_bytes: 0x10 
         930:  .vgpr_count: 0x3 
         931:  multiple_stack: 
         932:  .backend_stack_size: 0x24 
         933:  .lds_size: 0 
next:83'0                  X error: no match found
         934:  .sgpr_count: 0x21 
next:83'0     ~~~~~~~~~~~~~~~~~~~
next:83'1      ?                  possible intended match
         935:  .stack_frame_size_in_bytes: 0x24 
next:83'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         936:  .vgpr_count: 0x3 
next:83'0     ~~~~~~~~~~~~~~~~~~
         937:  no_stack: 
next:83'0     ~~~~~~~~~~~
         938:  .backend_stack_size: 0 
next:83'0     ~~~~~~~~~~~~~~~~~~~~~~~~
         939:  .lds_size: 0 
next:83'0     ~~~~~~~~~~~~~~
           .
           .
...

DrSergei pushed a commit to DrSergei/llvm-project that referenced this pull request Jun 24, 2025
Use a function attribute (amdgpu-dynamic-vgpr) instead of a subtarget
feature, as requested in llvm#130030.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants