[llvm] [AMDGPU] Rematerialize VGPR candidates when SGPR spills results in VGPR Excess (PR #168079)

Lucas Ramirez via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 18 08:15:27 PST 2025


Juan Manuel Martinez =?utf-8?q?Caamaño?=,
Juan Manuel Martinez =?utf-8?q?Caamaño?=,
Juan Manuel Martinez =?utf-8?q?Caamaño?=,
Juan Manuel Martinez =?utf-8?q?Caamaño?=,
Juan Manuel Martinez =?utf-8?q?Caamaño?Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/168079 at github.com>


================
@@ -97,6 +97,46 @@ void GCNRegPressure::inc(unsigned Reg,
   Value[RegKind] += Sign;
 }
 
+struct RegExcess {
+  unsigned SGPR = 0;
+  unsigned VGPR = 0;
+  unsigned ArchVGPR = 0;
+  unsigned AGPR = 0;
+
+  bool anyExcess() const { return SGPR || VGPR || ArchVGPR || AGPR; }
+  bool spillsToMemory() const { return VGPR || ArchVGPR || AGPR; }
----------------
lucas-rami wrote:

I find the function name slightly confusing. The maximum number of SGPRs/VGPRs is not necessarily the spilling limit, it just means we use too many VGPRs for the target we set out to achieve.

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


More information about the llvm-commits mailing list