Registers vcc_lo and vcc_hi are added to the checks for constant bus
restriction. This has resulted in two test failures:
- attr-amdgpu-num-sgpr.ll fails at instructions: %vgpr4<def> = V_MOV_B32_e32 %vcc_lo, ... %vcc<imp-use> %vgpr5<def> = V_MOV_B32_e32 %vcc_hi, ... %vcc<imp-use,kill> ...
We were incorrectly assuming that vcc and vcc_lo uses are distinct.
- inserted-wait-states.mir fails at the instruction:
%vgpr4<def> = V_WRITELANE_B32 %sgpr4, %vcc_lo
v_writelane_b32 is an exception from constant bus restriction: vsrc0 can be sgpr, const or m0 and lane select sgpr, m0 or inline-const.
Both verifier errors are fixed.
I was trying to clean this up recently to avoid having to list VCC here at all by checking SReg_32/SReg_64 classes instead. I think there's an issue here because implicit really means two different things. This really wants to be checking for the hardware implicit physical register uses from the instruction definition, which only applies to VCC. No instructions implicitly read just vcc_lo or vcc_hi. Implicit can also mean extra operands the compiler added on for modeling other constraints, which should not be verified for constant bus usage.