[llvm] [CodeGen] Utilizing register units based liveIns tracking in MBB (PR #129847)

Vikash Gupta via llvm-commits llvm-commits at lists.llvm.org
Fri May 2 00:21:05 PDT 2025


vg0204 wrote:

Also, there exists one AMDGPU LIT test (spill-sgpr-to-virtual-vgpr.mir) which also fails due to Exit code - 2 :

```
*** Bad machine code: Using an undefined physical register ***
- function:    sgpr_spill_lane_crossover
- basic block: %bb.0  (0x561c70171330)
- instruction: %0:vgpr_32 = SI_SPILL_S32_TO_VGPR $sgpr64, 1, %0:vgpr_32(tied-def 0), implicit-def $sgpr64_sgpr65_sgpr66_sgpr67_sgpr68_sgpr69_sgpr70_sgpr71_sgpr72_sgpr73_sgpr74_sgpr75_sgpr76_sgpr77_sgpr78_sgpr79_sgpr80_sgpr81_sgpr82_sgpr83_sgpr84_sgpr85_sgpr86_sgpr87_sgpr88_sgpr89_sgpr90_sgpr91_sgpr92_sgpr93_sgpr94_sgpr95, implicit $sgpr64_sgpr65_sgpr66_sgpr67_sgpr68_sgpr69_sgpr70_sgpr71_sgpr72_sgpr73_sgpr74_sgpr75_sgpr76_sgpr77_sgpr78_sgpr79_sgpr80_sgpr81_sgpr82_sgpr83_sgpr84_sgpr85_sgpr86_sgpr87_sgpr88_sgpr89_sgpr90_sgpr91_sgpr92_sgpr93_sgpr94_sgpr95
- operand 5:   implicit $sgpr64_sgpr65_sgpr66_sgpr67_sgpr68_sgpr69_sgpr70_sgpr71_sgpr72_sgpr73_sgpr74_sgpr75_sgpr76_sgpr77_sgpr78_sgpr79_sgpr80_sgpr81_sgpr82_sgpr83_sgpr84_sgpr85_sgpr86_sgpr87_sgpr88_sgpr89_sgpr90_sgpr91_sgpr92_sgpr93_sgpr94_sgpr95
```

As before MachineVerifier adds liveIns with Regs & their Subregs, so even if each of $sgpr64..sgpr95 has been killed, the superReg itself exists as per the current implemetenation for tracking liveness, so no issues. But, now with dealing with RegUnits it cannot be hold true. So, as you said @arsenm we need to redefine the MachineVerifier behave to accomodate MBB_livein' changes.

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


More information about the llvm-commits mailing list