Skip to content

Conversation

@shiltian
Copy link
Contributor

@shiltian shiltian commented Nov 8, 2024

No description provided.

Copy link
Contributor Author

shiltian commented Nov 8, 2024

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @shiltian and the rest of your teammates on Graphite Graphite

@shiltian shiltian deleted the users/shiltian/inreg-call-crash-cov4 branch November 8, 2024 16:09
@llvmbot
Copy link
Member

llvmbot commented Nov 8, 2024

@llvm/pr-subscribers-backend-amdgpu

Author: Shilei Tian (shiltian)

Changes

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

1 Files Affected:

  • (modified) llvm/lib/Target/AMDGPU/SIFrameLowering.cpp (+10-1)
diff --git a/llvm/lib/Target/AMDGPU/SIFrameLowering.cpp b/llvm/lib/Target/AMDGPU/SIFrameLowering.cpp
index 13a2db7a87b437..8e3208abaec9a5 100644
--- a/llvm/lib/Target/AMDGPU/SIFrameLowering.cpp
+++ b/llvm/lib/Target/AMDGPU/SIFrameLowering.cpp
@@ -59,9 +59,18 @@ static MCRegister findScratchNonCalleeSaveRegister(
   if (Unused)
     return findUnusedRegister(MRI, LiveUnits, RC);
 
+  dbgs() << "--------\n";
+
   for (MCRegister Reg : RC) {
-    if (LiveUnits.available(Reg) && !MRI.isReserved(Reg))
+    dbgs() << "reg " << Reg << " avail? " << LiveUnits.available(Reg)
+           << ", reserved? " << MRI.isReserved(Reg) << "\n";
+  }
+
+  for (MCRegister Reg : RC) {
+    if (LiveUnits.available(Reg) && !MRI.isReserved(Reg)) {
+      dbgs() << "--------choose reg " << Reg << '\n';
       return Reg;
+    }
   }
 
   return MCRegister();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants