[llvm] [AMDGPU] Fix DEALLOC_VGPRS in the presence of spills to scratch (PR #178461)

Jay Foad via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 28 08:42:38 PST 2026


================
@@ -4481,10 +4481,6 @@ bool SIInstrInfo::mayAccessScratch(const MachineInstr &MI) const {
   if ((!isFLAT(MI) || isFLATGlobal(MI)) && !isBUF(MI))
     return false;
 
-  // If scratch is not initialized, we can never access it.
-  if (MI.getMF()->getFunction().hasFnAttribute("amdgpu-no-flat-scratch-init"))
-    return false;
-
----------------
jayfoad wrote:

Ah, so I could keep this check but put it after the `if (TII->isFLATScratch(MI)) return true;` that was removed in #150586.

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


More information about the llvm-commits mailing list