[llvm-branch-commits] [llvm] [AMDGPU] Apply occupancy-aware register allocation anti-hints (PR #218074)
Syadus Sefat via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Tue Sep 15 17:51:37 PDT 2026
================
@@ -4225,22 +4225,56 @@ bool SIRegisterInfo::shouldApplyAntiHints(
return true;
}
+// Returns true if Reg fits within the current occupancy VGPR budget.
+bool SIRegisterInfo::isRegWithinOccupancyBudget(
+ MCPhysReg Reg, unsigned NumVGPRs, unsigned NumAGPRs,
+ unsigned MaxVGPRsForCurrentOccupancy) const {
+ const TargetRegisterClass *RC = getPhysRegBaseClass(Reg);
+
+ // No VGPR or AGPR usage.
+ if (!RC || (!isVGPRClass(RC) && !isAGPRClass(RC)))
----------------
mssefat wrote:
Fixed.
https://github.com/llvm/llvm-project/pull/218074
More information about the llvm-branch-commits
mailing list