Skip to content

RegAllocGreedy: Remove unnecessary null register class check #128487

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

Merged
merged 1 commit into from
Feb 24, 2025

Conversation

arsenm
Copy link
Contributor

@arsenm arsenm commented Feb 24, 2025

No description provided.

Copy link
Contributor Author

arsenm commented Feb 24, 2025

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

@llvmbot
Copy link
Member

llvmbot commented Feb 24, 2025

@llvm/pr-subscribers-llvm-regalloc

Author: Matt Arsenault (arsenm)

Changes

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

1 Files Affected:

  • (modified) llvm/lib/CodeGen/RegAllocGreedy.cpp (-3)
diff --git a/llvm/lib/CodeGen/RegAllocGreedy.cpp b/llvm/lib/CodeGen/RegAllocGreedy.cpp
index 08aec54f02408..6b494a2ce006d 100644
--- a/llvm/lib/CodeGen/RegAllocGreedy.cpp
+++ b/llvm/lib/CodeGen/RegAllocGreedy.cpp
@@ -2710,9 +2710,6 @@ bool RAGreedy::hasVirtRegAlloc() {
     Register Reg = Register::index2VirtReg(I);
     if (MRI->reg_nodbg_empty(Reg))
       continue;
-    const TargetRegisterClass *RC = MRI->getRegClass(Reg);
-    if (!RC)
-      continue;
     if (shouldAllocateRegister(Reg))
       return true;
   }

@arsenm arsenm marked this pull request as ready for review February 24, 2025 10:21
@arsenm arsenm merged commit b66ec64 into main Feb 24, 2025
13 of 15 checks passed
@arsenm arsenm deleted the users/arsenm/greedy-remove-reg-class-check branch February 24, 2025 15:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants