[llvm] [AMDGPU] Check for a live interval before querying register kind in getLiveRegs (PR #209328)

via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 14 10:46:43 PDT 2026


================
@@ -509,11 +509,15 @@ GCNRPTracker::LiveRegSet llvm::getLiveRegs(SlotIndex SI,
   GCNRPTracker::LiveRegSet LiveRegs;
   for (unsigned I = 0, E = MRI.getNumVirtRegs(); I != E; ++I) {
     auto Reg = Register::index2VirtReg(I);
+    // Check for a live interval before querying the register kind: getRegKind
+    // reads the register class, which is unset for classless vregs (e.g. unused
+    // GlobalISel InstructionSelect leftovers). Such vregs have no interval, so
+    // testing hasInterval first skips them without touching their (absent) class.
----------------
alex-t wrote:

And so, what? :) AI is far more proficient in English then I am.
On a serious note, if you can suggest a better wording, don't hesitate to do so. I\d really appreciate

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


More information about the llvm-commits mailing list