[llvm] [AMDGPU] Use correct SlotIndex to calculate live-out register set. (PR #161720)

Valery Pykhtin via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 3 05:03:24 PDT 2025


================
@@ -905,33 +907,32 @@ bool GCNRegPressurePrinter::runOnMachineFunction(MachineFunction &MF) {
     OS << ":\n";
 
     SlotIndex MBBStartSlot = LIS.getSlotIndexes()->getMBBStartIdx(&MBB);
-    SlotIndex MBBEndSlot = LIS.getSlotIndexes()->getMBBEndIdx(&MBB);
+    SlotIndex MBBLastSlot = LIS.getSlotIndexes()->getMBBLastIdx(&MBB);
+    bool MBBHasNonDebugInstrs = MBBStartSlot != MBBLastSlot.getBaseIndex();
----------------
vpykhtin wrote:

Debug instructions doesn't have slot index. If the basic block is empty or contains only debug instructions MBBEndIdx(MBB).getPrevIndex() will return slot index equal to MBBStartIdx(MBB)

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


More information about the llvm-commits mailing list