We can only get the register classes of virtual registers, not of
physical registers. The previous code crashed for vector instructions that
use physical registers.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
I’ll add a test case. Yes, this is related to the atomic optimizer and ballot intrinsic. There we get e.g. %0:vgpr_32 = V_MBCNT_LO_U32_B32_e64 $exec_lo, 0, implicit $exec.
I still think theses should not be seeing physical register operands, and it would be better to fix this by avoiding that situation
Why is introducing a copy a better fix? And does this mean I should return a COPY when doing (ballot 1) -> EXEC/EXEC_LO here? https://reviews.llvm.org/D65088#C1855323NL8643
Wouldn’t a copy use an SGPR and increase the SGPR-count? Then we would generate less optimal code, right?
It should be eliminated later. Introducing physical register constraints earlier is generally bad. I would also worry about earlier passes not expected a non-implicit exec use
clang-format: please reformat the code