Skip to content

[AMDGPU][Scheduler] Add GCNRegPressure-based methods to GCNRPTarget - #182853

Merged
lucas-rami merged 2 commits into
llvm:mainfrom
lucas-rami:gcn-target-use-gcn-pressure
Feb 27, 2026
Merged

lucas-rami merged 2 commits into
llvm:mainfrom
lucas-rami:gcn-target-use-gcn-pressure

Conversation

@lucas-rami

Copy link
Copy Markdown
Contributor

This adds a few methods to GCNRPTarget that can estimate/perform RP savings based on GCNRegPressure instead of a single Register, opening the door to model/incorporate more complex savings made up of multiple registers of potentially different classes. The scheduler's rematerialization stage now uses this new API.

Although there are no test changes this is not really NFC since register pressure savings in the rematerialization stage are now computed through GCNRegPressure instead of the stage itself. If anything this makes them more consistent with the rest of the RP-tracking infrastructure.

This adds a few methods to `GCNRPTarget` that can estimate/perform RP
savings based on `GCNRegPressure` instead of a single `Register`,
opening the door to model/incorporate more complex savings made up of
multiple registers of potentially different classes. The scheduler's
rematerialization stage now uses this new API.

Although there are no test changes this is not really NFC since register
pressure savings in the rematerialization stage are now computed through
`GCNRegPressure` instead of the stage itself. If anything this makes
them more consistent with the rest of the RP-tracking infrastructure.
@llvmbot

llvmbot commented Feb 23, 2026

Copy link
Copy Markdown
Member

@llvm/pr-subscribers-backend-amdgpu

Author: Lucas Ramirez (lucas-rami)

Changes

This adds a few methods to GCNRPTarget that can estimate/perform RP savings based on GCNRegPressure instead of a single Register, opening the door to model/incorporate more complex savings made up of multiple registers of potentially different classes. The scheduler's rematerialization stage now uses this new API.

Although there are no test changes this is not really NFC since register pressure savings in the rematerialization stage are now computed through GCNRegPressure instead of the stage itself. If anything this makes them more consistent with the rest of the RP-tracking infrastructure.


Full diff: https://github.com/llvm/llvm-project/pull/182853.diff

4 Files Affected:

  • (modified) llvm/lib/Target/AMDGPU/GCNRegPressure.cpp (+27-3)
  • (modified) llvm/lib/Target/AMDGPU/GCNRegPressure.h (+10-1)
  • (modified) llvm/lib/Target/AMDGPU/GCNSchedStrategy.cpp (+49-51)
  • (modified) llvm/lib/Target/AMDGPU/GCNSchedStrategy.h (+11-13)
diff --git a/llvm/lib/Target/AMDGPU/GCNRegPressure.cpp b/llvm/lib/Target/AMDGPU/GCNRegPressure.cpp
index 89307ef9767b7..500c00dec22cf 100644
--- a/llvm/lib/Target/AMDGPU/GCNRegPressure.cpp
+++ b/llvm/lib/Target/AMDGPU/GCNRegPressure.cpp
@@ -424,10 +424,34 @@ bool GCNRPTarget::isSaveBeneficial(Register Reg) const {
   return (UnifiedRF && Excess.VGPR) || Excess.ArchVGPR;
 }
 
-bool GCNRPTarget::satisfied() const {
-  if (RP.getSGPRNum() > MaxSGPRs || RP.getVGPRNum(false) > MaxVGPRs)
+unsigned GCNRPTarget::getNumRegsBenefit(const GCNRegPressure &SaveRP) const {
+  RegExcess Excess(MF, RP, *this);
+  unsigned NumRegsSaved = 0;
+  unsigned NumVGPRAboveAddrLimit = 0;
+
+  if (Excess.SGPR)
+    NumRegsSaved += std::min(Excess.SGPR, SaveRP.getSGPRNum());
+  if (Excess.ArchVGPR)
+    NumVGPRAboveAddrLimit += std::min(Excess.ArchVGPR, SaveRP.getArchVGPRNum());
+  if (Excess.AGPR)
+    NumVGPRAboveAddrLimit += std::min(Excess.AGPR, SaveRP.getAGPRNum());
+  NumRegsSaved += NumVGPRAboveAddrLimit;
+
+  if (UnifiedRF && Excess.VGPR) {
+    // Do not double-count VGPRs that are both above the addressable limit in
+    // their respective class and contribute to an overall excess in VGPR.
+    const unsigned VGPRSave = SaveRP.getVGPRNum(true);
+    if (NumVGPRAboveAddrLimit < VGPRSave)
+      NumRegsSaved += std::min(Excess.VGPR, VGPRSave - NumVGPRAboveAddrLimit);
+  }
+
+  return NumRegsSaved;
+}
+
+bool GCNRPTarget::satisfied(const GCNRegPressure &TestRP) const {
+  if (TestRP.getSGPRNum() > MaxSGPRs || TestRP.getVGPRNum(false) > MaxVGPRs)
     return false;
-  if (UnifiedRF && RP.getVGPRNum(true) > MaxUnifiedVGPRs)
+  if (UnifiedRF && TestRP.getVGPRNum(true) > MaxUnifiedVGPRs)
     return false;
   return true;
 }
diff --git a/llvm/lib/Target/AMDGPU/GCNRegPressure.h b/llvm/lib/Target/AMDGPU/GCNRegPressure.h
index c55796c37f287..80121d6eb7def 100644
--- a/llvm/lib/Target/AMDGPU/GCNRegPressure.h
+++ b/llvm/lib/Target/AMDGPU/GCNRegPressure.h
@@ -255,8 +255,17 @@ class GCNRPTarget {
     RP.inc(Reg, Mask, LaneBitmask::getNone(), MRI);
   }
 
+  /// Returns the benefit towards achieving the RP target that saving \p SaveRP
+  /// represents, in total number of registers saved across all classes.
+  unsigned getNumRegsBenefit(const GCNRegPressure &SaveRP) const;
+
+  /// Saves a total pressure of \p SaveRP.
+  void saveRP(const GCNRegPressure &SaveRP) { RP -= SaveRP; }
+
+  /// Whether \p TestRP is at or below the defined pressure target.
+  bool satisfied(const GCNRegPressure &TestRP) const;
   /// Whether the current RP is at or below the defined pressure target.
-  bool satisfied() const;
+  bool satisfied() const { return satisfied(RP); }
   bool hasVectorRegisterExcess() const;
 
   unsigned getMaxSGPRs() const { return MaxSGPRs; }
diff --git a/llvm/lib/Target/AMDGPU/GCNSchedStrategy.cpp b/llvm/lib/Target/AMDGPU/GCNSchedStrategy.cpp
index b0441955e70b9..62969b89f8a8f 100644
--- a/llvm/lib/Target/AMDGPU/GCNSchedStrategy.cpp
+++ b/llvm/lib/Target/AMDGPU/GCNSchedStrategy.cpp
@@ -1566,15 +1566,36 @@ bool PreRARematStage::initGCNSchedStage() {
         break;
 
       REMAT_DEBUG(dbgs() << "** REMAT " << PrintRematReg(Remat) << '\n';);
+      MachineInstr *RematMI =
+          Candidate.rematerialize(RecomputeRP, RPTargets, DAG);
+      RescheduleRegions |= Remat.Live;
+
       // Every rematerialization we do here is likely to move the instruction
       // into a higher frequency region, increasing the total sum latency of the
       // instruction itself. This is acceptable if we are eliminating a spill in
       // the process, but when the goal is increasing occupancy we get nothing
       // out of rematerialization if occupancy is not increased in the end; in
       // such cases we want to roll back the rematerialization.
-      RollbackInfo *Rollback =
-          TargetOcc ? &Rollbacks.emplace_back(&Remat) : nullptr;
-      rematerialize(Remat, RecomputeRP, Rollback);
+      if (TargetOcc) {
+        RollbackInfo &Rollback = Rollbacks.emplace_back(&Remat);
+        Rollback.RematMI = RematMI;
+        // Make the original MI a debug value so that it does not influence
+        // scheduling and replace all read registers with a sentinel register to
+        // prevent operands to appear in use-lists of other MIs during LIS
+        // updates. Store mappings between operand indices and original
+        // registers for potential rollback.
+        Remat.DefMI->setDesc(DAG.TII->get(TargetOpcode::DBG_VALUE));
+        for (auto [Idx, MO] : enumerate(Remat.DefMI->operands())) {
+          if (MO.isReg() && MO.readsReg()) {
+            Rollback.RegMap.insert({Idx, MO.getReg()});
+            MO.setReg(Register());
+          }
+        }
+      } else {
+        // Just delete the original instruction if it cannot be rolled back.
+        DAG.deleteMI(Remat.DefRegion, Remat.DefMI);
+      }
+
       unsetSatisifedRPTargets(Remat.Live);
     }
 
@@ -2885,21 +2906,8 @@ PreRARematStage::ScoredRemat::FreqInfo::FreqInfo(
 
 PreRARematStage::ScoredRemat::ScoredRemat(RematReg *Remat, const FreqInfo &Freq,
                                           const GCNScheduleDAGMILive &DAG)
-    : Remat(Remat), NumRegs(getNumRegs(DAG)), FreqDiff(getFreqDiff(Freq)) {}
-
-unsigned PreRARematStage::ScoredRemat::getNumRegs(
-    const GCNScheduleDAGMILive &DAG) const {
-  const TargetRegisterClass &RC = *DAG.MRI.getRegClass(Remat->getReg());
-  unsigned RegSize = DAG.TRI->getRegSizeInBits(RC);
-  if (unsigned SubIdx = Remat->DefMI->getOperand(0).getSubReg()) {
-    // The following may return -1 (i.e., a large unsigned number) on indices
-    // that may be used to access subregisters of multiple sizes; in such cases
-    // fallback on the size derived from the register class.
-    unsigned SubRegSize = DAG.TRI->getSubRegIdxSize(SubIdx);
-    if (SubRegSize < RegSize)
-      RegSize = SubRegSize;
-  }
-  return divideCeil(RegSize, 32);
+    : Remat(Remat), FreqDiff(getFreqDiff(Freq)) {
+  RPSave.inc(Remat->getReg(), LaneBitmask::getNone(), Remat->Mask, DAG.MRI);
 }
 
 int64_t PreRARematStage::ScoredRemat::getFreqDiff(const FreqInfo &Freq) const {
@@ -2924,12 +2932,21 @@ void PreRARematStage::ScoredRemat::update(const BitVector &TargetRegions,
   MaxFreq = 0;
   RegionImpact = 0;
   for (unsigned I : TargetRegions.set_bits()) {
-    if (!Remat->Live[I] || !RPTargets[I].isSaveBeneficial(Remat->getReg()))
+    if (!Remat->Live[I])
       continue;
+
+    // The rematerialization must contribute positively in at least one
+    // register class with usage above the RP target for this region to
+    // contribute to the score.
+    const GCNRPTarget &RegionTarget = RPTargets[I];
+    const unsigned NumRegsBenefit = RegionTarget.getNumRegsBenefit(RPSave);
+    if (!NumRegsBenefit)
+      continue;
+
     bool UnusedLT = Remat->isUnusedLiveThrough(I);
 
     // Regions in which RP is guaranteed to decrease have more weight.
-    RegionImpact += UnusedLT ? 2 : 1;
+    RegionImpact += (UnusedLT ? 2 : 1) * NumRegsBenefit;
 
     if (ReduceSpill) {
       uint64_t Freq = FreqInfo.Regions[I];
@@ -2941,41 +2958,22 @@ void PreRARematStage::ScoredRemat::update(const BitVector &TargetRegions,
       MaxFreq = std::max(MaxFreq, Freq);
     }
   }
-  RegionImpact *= NumRegs;
 }
 
-void PreRARematStage::rematerialize(const RematReg &Remat,
-                                    BitVector &RecomputeRP,
-                                    RollbackInfo *Rollback) {
-  const SIInstrInfo *TII = MF.getSubtarget<GCNSubtarget>().getInstrInfo();
-  MachineInstr &DefMI = *Remat.DefMI;
+MachineInstr *PreRARematStage::ScoredRemat::rematerialize(
+    BitVector &RecomputeRP, SmallVectorImpl<GCNRPTarget> &RPTargets,
+    GCNScheduleDAGMILive &DAG) const {
+  const SIInstrInfo *TII = DAG.MF.getSubtarget<GCNSubtarget>().getInstrInfo();
+  MachineInstr &DefMI = *Remat->DefMI;
   Register Reg = DefMI.getOperand(0).getReg();
   Register NewReg = DAG.MRI.cloneVirtualRegister(Reg);
 
   // Rematerialize the register in the region where it is used.
-  MachineBasicBlock::iterator InsertPos = Remat.UseMI;
+  MachineBasicBlock::iterator InsertPos = Remat->UseMI;
   TII->reMaterialize(*InsertPos->getParent(), InsertPos, NewReg, 0, DefMI);
   MachineInstr *RematMI = &*std::prev(InsertPos);
-  Remat.UseMI->substituteRegister(Reg, NewReg, 0, *DAG.TRI);
-  Remat.insertMI(Remat.UseRegion, RematMI, DAG);
-  if (Rollback) {
-    Rollback->RematMI = RematMI;
-    // Make the original MI a debug value so that it does not influence
-    // scheduling and replace all read registers with a sentinel register to
-    // prevent operands to appear in use-lists of other MIs during LIS
-    // updates. Store mappings between operand indices and original registers
-    // for potential rollback.
-    DefMI.setDesc(TII->get(TargetOpcode::DBG_VALUE));
-    for (auto [Idx, MO] : enumerate(Remat.DefMI->operands())) {
-      if (MO.isReg() && MO.readsReg()) {
-        Rollback->RegMap.insert({Idx, MO.getReg()});
-        MO.setReg(Register());
-      }
-    }
-  } else {
-    // Just delete the original instruction if it cannot be rolled back.
-    DAG.deleteMI(Remat.DefRegion, &DefMI);
-  }
+  Remat->UseMI->substituteRegister(Reg, NewReg, 0, *DAG.TRI);
+  Remat->insertMI(Remat->UseRegion, RematMI, DAG);
 
 #ifdef EXPENSIVE_CHECKS
   // All uses are known to be available / live at the remat point. Thus,
@@ -3010,15 +3008,15 @@ void PreRARematStage::rematerialize(const RematReg &Remat,
   // and adjust RP targets. The save is guaranteed in regions in which the
   // register is live-through and unused but optimistic in all other regions
   // where the register is live.
-  for (unsigned I : Remat.Live.set_bits()) {
-    RPTargets[I].saveReg(Reg, Remat.Mask, DAG.MRI);
+  for (unsigned I : Remat->Live.set_bits()) {
+    RPTargets[I].saveRP(RPSave);
     DAG.LiveIns[I].erase(Reg);
     DAG.RegionLiveOuts.getLiveRegsForRegionIdx(I).erase(Reg);
-    if (!Remat.isUnusedLiveThrough(I))
+    if (!Remat->isUnusedLiveThrough(I))
       RecomputeRP.set(I);
   }
 
-  RescheduleRegions |= Remat.Live;
+  return RematMI;
 }
 
 void PreRARematStage::commitRematerializations() const {
diff --git a/llvm/lib/Target/AMDGPU/GCNSchedStrategy.h b/llvm/lib/Target/AMDGPU/GCNSchedStrategy.h
index 6b6a40365b52d..eb283c6b37805 100644
--- a/llvm/lib/Target/AMDGPU/GCNSchedStrategy.h
+++ b/llvm/lib/Target/AMDGPU/GCNSchedStrategy.h
@@ -596,6 +596,14 @@ class PreRARematStage : public GCNSchedStage {
     ScoredRemat(RematReg *Remat, const FreqInfo &Freq,
                 const GCNScheduleDAGMILive &DAG);
 
+    /// Rematerializes the candidate and returns the new MI. This removes the
+    /// rematerialized register from live-in/out lists in the \p DAG and updates
+    /// \p RPTargets in all affected regions. Regions in which RP savings are
+    /// not guaranteed are set in \p RecomputeRP.
+    MachineInstr *rematerialize(BitVector &RecomputeRP,
+                                SmallVectorImpl<GCNRPTarget> &RPTargets,
+                                GCNScheduleDAGMILive &DAG) const;
+
     /// Updates the rematerialization's score w.r.t. the current \p RPTargets.
     /// \p RegionFreq indicates the frequency of each region
     void update(const BitVector &TargetRegions, ArrayRef<GCNRPTarget> RPTargets,
@@ -631,8 +639,9 @@ class PreRARematStage : public GCNSchedStage {
 #endif
 
   private:
-    /// Number of 32-bit registers this rematerialization covers.
-    unsigned NumRegs;
+    /// Expected register pressure decrease induced by rematerializing this
+    /// candidate.
+    GCNRegPressure RPSave;
 
     // The three members below are the scoring components, top to bottom from
     // most important to least important when comparing candidates.
@@ -649,8 +658,6 @@ class PreRARematStage : public GCNSchedStage {
     /// scaled by the size of the register being rematerialized.
     unsigned RegionImpact;
 
-    unsigned getNumRegs(const GCNScheduleDAGMILive &DAG) const;
-
     int64_t getFreqDiff(const FreqInfo &Freq) const;
   };
 
@@ -729,15 +736,6 @@ class PreRARematStage : public GCNSchedStage {
   /// rematerializable register was found.
   bool collectRematRegs(const DenseMap<MachineInstr *, unsigned> &MIRegion);
 
-  /// Rematerializes \p Remat. This removes the rematerialized register from
-  /// live-in/out lists in the DAG and updates RP targets in all affected
-  /// regions, which are also marked in \ref RescheduleRegions. Regions in which
-  /// RP savings are not guaranteed are set in \p RecomputeRP. When \p Rollback
-  /// is non-null, fills it with required information to be able to rollback the
-  /// rematerialization post-rescheduling.
-  void rematerialize(const RematReg &Remat, BitVector &RecomputeRP,
-                     RollbackInfo *Rollback);
-
   /// Deletes all rematerialized MIs from the MIR when they were kept around for
   /// potential rollback.
   void commitRematerializations() const;

@qcolombet qcolombet left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

You're the expert here and the refactoring looks fine at the high level, so approving.
There are a few things that I highlighted that made me pause.

// Just delete the original instruction if it cannot be rolled back.
DAG.deleteMI(Remat.DefRegion, Remat.DefMI);
}

unsetSatisifedRPTargets(Remat.Live);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

While here, maybe we can fix the typo in the here :)
Satisified => Satisfied.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Missed that, thanks for the catch :)

NumVGPRAboveAddrLimit += std::min(Excess.AGPR, SaveRP.getAGPRNum());
NumRegsSaved += NumVGPRAboveAddrLimit;

if (UnifiedRF && Excess.VGPR) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think the special case for UnifiedRF would benefit a quick reminder of why we're doing this.
I feel the code work because you know the implementation of getVGPRNum(true), but for me who's not familiar with all that, this just looks like black magic.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I tried to clarify a little bit the intent there. I also swapped SaveRPgetVGPRNum(true) for SaveRP.getArchVGPRNum() + SaveRP.getAGPRNum(), which in practice is almost identical. The former just introduces an allocation granule in the calculation which is relevant for actual occupancy estimates (i.e., the hardware can only allocate ArchVGPR in increments of this granule) but not in this saving calculation.

Comment thread llvm/lib/Target/AMDGPU/GCNRegPressure.h Outdated
unsigned getNumRegsBenefit(const GCNRegPressure &SaveRP) const;

/// Saves a total pressure of \p SaveRP.
void saveRP(const GCNRegPressure &SaveRP) { RP -= SaveRP; }

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should we assert that RP is >= than SaveRP?

Comment thread llvm/lib/Target/AMDGPU/GCNRegPressure.cpp Outdated
@lucas-rami
lucas-rami merged commit bf3ab0d into llvm:main Feb 27, 2026
10 checks passed
@llvm-ci

llvm-ci commented Feb 27, 2026

Copy link
Copy Markdown

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 6 "build-default".

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

Here is the relevant piece of the build log for the reference
Step 6 (build-default) failure: cmake (failure)
...
92.703 [27/14/4123] Building CXX object tools/llvm-reduce/CMakeFiles/llvm-reduce.dir/deltas/SimplifyInstructions.cpp.o
92.728 [27/13/4124] Building CXX object tools/llvm-split/CMakeFiles/llvm-split.dir/llvm-split.cpp.o
92.747 [27/12/4125] Building CXX object tools/opt/CMakeFiles/opt.dir/opt.cpp.o
92.781 [27/11/4126] Building CXX object tools/opt/CMakeFiles/LLVMOptDriver.dir/NewPMDriver.cpp.o
92.832 [27/10/4127] Building CXX object lib/Target/AMDGPU/CMakeFiles/LLVMAMDGPUCodeGen.dir/SIRegisterInfo.cpp.o
92.833 [27/9/4128] Building CXX object tools/opt/CMakeFiles/LLVMOptDriver.dir/optdriver.cpp.o
93.245 [27/8/4129] Building CXX object lib/Target/AMDGPU/CMakeFiles/LLVMAMDGPUCodeGen.dir/AMDGPUInstructionSelector.cpp.o
94.810 [27/7/4130] Building CXX object lib/Target/AMDGPU/CMakeFiles/LLVMAMDGPUCodeGen.dir/SIFormMemoryClauses.cpp.o
94.986 [27/6/4131] Building CXX object lib/Target/AMDGPU/CMakeFiles/LLVMAMDGPUCodeGen.dir/GCNIterativeScheduler.cpp.o
95.027 [27/5/4132] Building CXX object lib/Target/AMDGPU/CMakeFiles/LLVMAMDGPUCodeGen.dir/GCNSchedStrategy.cpp.o
FAILED: lib/Target/AMDGPU/CMakeFiles/LLVMAMDGPUCodeGen.dir/GCNSchedStrategy.cpp.o 
CCACHE_CPP2=yes CCACHE_HASHDIR=yes CCACHE_SLOPPINESS=pch_defines,time_macros /usr/bin/ccache /usr/bin/clang++-21 -DEXPENSIVE_CHECKS -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GLIBCXX_DEBUG -D_GLIBCXX_USE_CXX11_ABI=1 -D_GNU_SOURCE -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/buildbot/worker/as-builder-4/ramdisk/expensive-checks/build/lib/Target/AMDGPU -I/home/buildbot/worker/as-builder-4/ramdisk/expensive-checks/llvm-project/llvm/lib/Target/AMDGPU -I/home/buildbot/worker/as-builder-4/ramdisk/expensive-checks/build/include -I/home/buildbot/worker/as-builder-4/ramdisk/expensive-checks/llvm-project/llvm/include -U_GLIBCXX_DEBUG -Wno-misleading-indentation -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wno-pass-failed -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -Xclang -fno-pch-timestamp -O3 -DNDEBUG -std=c++17 -fvisibility=hidden -UNDEBUG -fno-exceptions -funwind-tables -fno-rtti -Winvalid-pch -Xclang -include-pch -Xclang /home/buildbot/worker/as-builder-4/ramdisk/expensive-checks/build/lib/CodeGen/CMakeFiles/LLVMCodeGen.dir/cmake_pch.hxx.pch -Xclang -include -Xclang /home/buildbot/worker/as-builder-4/ramdisk/expensive-checks/build/lib/CodeGen/CMakeFiles/LLVMCodeGen.dir/cmake_pch.hxx -MD -MT lib/Target/AMDGPU/CMakeFiles/LLVMAMDGPUCodeGen.dir/GCNSchedStrategy.cpp.o -MF lib/Target/AMDGPU/CMakeFiles/LLVMAMDGPUCodeGen.dir/GCNSchedStrategy.cpp.o.d -o lib/Target/AMDGPU/CMakeFiles/LLVMAMDGPUCodeGen.dir/GCNSchedStrategy.cpp.o -c /home/buildbot/worker/as-builder-4/ramdisk/expensive-checks/llvm-project/llvm/lib/Target/AMDGPU/GCNSchedStrategy.cpp
/home/buildbot/worker/as-builder-4/ramdisk/expensive-checks/llvm-project/llvm/lib/Target/AMDGPU/GCNSchedStrategy.cpp:3006:47: error: member reference type 'RematReg *const' is a pointer; did you mean to use '->'?
 3006 |     LaneBitmask LiveInMask = DAG.LiveIns[Remat.UseRegion].at(UseReg);
      |                                          ~~~~~^
      |                                               ->
1 error generated.
95.865 [27/4/4133] Building CXX object lib/Target/AMDGPU/CMakeFiles/LLVMAMDGPUCodeGen.dir/GCNRegPressure.cpp.o
97.861 [27/3/4134] Building CXX object lib/Target/AMDGPU/CMakeFiles/LLVMAMDGPUCodeGen.dir/R600ISelDAGToDAG.cpp.o
99.420 [27/2/4135] Building CXX object lib/Target/AMDGPU/CMakeFiles/LLVMAMDGPUCodeGen.dir/AMDGPUISelDAGToDAG.cpp.o
111.501 [27/1/4136] Building CXX object lib/Target/AMDGPU/CMakeFiles/LLVMAMDGPUCodeGen.dir/AMDGPUTargetMachine.cpp.o
ninja: build stopped: subcommand failed.

lucas-rami added a commit that referenced this pull request Feb 27, 2026
@llvm-ci

llvm-ci commented Feb 27, 2026

Copy link
Copy Markdown

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

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

Here is the relevant piece of the build log for the reference
Step 6 (test-build-unified-tree-check-flang) failure: 1200 seconds without output running [b'ninja', b'check-flang'], attempting to kill
...
PASS: Flang :: Driver/mcmodel.f90 (4219 of 4230)
PASS: Flang :: Driver/fopenmp.f90 (4220 of 4230)
PASS: Flang :: Transforms/vscale-attr.fir (4221 of 4230)
PASS: Flang :: Driver/global-isel.f90 (4222 of 4230)
PASS: Flang :: Driver/use-module.f90 (4223 of 4230)
PASS: Flang :: Lower/OpenMP/rtl-flags.f90 (4224 of 4230)
PASS: Flang :: Fir/target-rewrite-complex.fir (4225 of 4230)
PASS: Flang :: Driver/linker-options.f90 (4226 of 4230)
PASS: Flang :: Driver/omp-driver-offload.f90 (4227 of 4230)
PASS: Flang :: Driver/linker-flags.f90 (4228 of 4230)
command timed out: 1200 seconds without output running [b'ninja', b'check-flang'], attempting to kill
process killed by signal 9
program finished with exit code -1
elapsedTime=2075.785403

sujianIBM pushed a commit to sujianIBM/llvm-project that referenced this pull request Mar 5, 2026
…t` (llvm#182853)

This adds a few methods to `GCNRPTarget` that can estimate/perform RP
savings based on `GCNRegPressure` instead of a single `Register`,
opening the door to model/incorporate more complex savings made up of
multiple registers of potentially different classes. The scheduler's
rematerialization stage now uses this new API.

Although there are no test changes this is not really NFC since register
pressure savings in the rematerialization stage are now computed through
`GCNRegPressure` instead of the stage itself. If anything this makes
them more consistent with the rest of the RP-tracking infrastructure.
sujianIBM pushed a commit to sujianIBM/llvm-project that referenced this pull request Mar 5, 2026
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.

5 participants