Skip to content

[AMDGPU] Fix #115505

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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.

2 participants