[llvm] RegAllocGreedy: Remove unnecessary null register class check (PR #128487)

via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 24 02:21:27 PST 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-llvm-regalloc

Author: Matt Arsenault (arsenm)

<details>
<summary>Changes</summary>



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


1 Files Affected:

- (modified) llvm/lib/CodeGen/RegAllocGreedy.cpp (-3) 


``````````diff
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;
   }

``````````

</details>


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


More information about the llvm-commits mailing list