[AMDGPU] Fix odd implicit operand handling in clause breaking
authorJay Foad <jay.foad@amd.com>
Fri, 19 May 2023 09:29:32 +0000 (10:29 +0100)
committerJay Foad <jay.foad@amd.com>
Fri, 19 May 2023 20:24:33 +0000 (21:24 +0100)
commit890c76a9314a0b2fca7341b9307955ed83dccfc0
tree27d7d276d224589e748432341fdc8e7cabb6eae4
parent3fb1041165d78bee8fa9a0871d78a4d54fcea11f
[AMDGPU] Fix odd implicit operand handling in clause breaking

By inspection. Because of the strange behaviour of MI.uses(), this was
adding implicit defs to the clause *uses* set, and then wrongly
detecting a conflict between explicit defs and implicit defs.

For example it would detect a conflict on this pair of instructions:

   $vgpr0 = BUFFER_LOAD_DWORD_OFFSET $sgpr0_sgpr1_sgpr2_sgpr3, 0, 4088, 0, 0, implicit $exec, implicit-def $vgpr0_vgpr1 :: (load (s32) from %stack.1, addrspace 5)
   $vgpr1 = BUFFER_LOAD_DWORD_OFFSET $sgpr0_sgpr1_sgpr2_sgpr3, 0, 4092, 0, 0, implicit $exec, implicit-def $vgpr0_vgpr1 :: (load (s32) from %stack.1 + 4, addrspace 5)

Differential Revision: https://reviews.llvm.org/D150947
llvm/lib/Target/AMDGPU/GCNHazardRecognizer.cpp
llvm/test/CodeGen/AMDGPU/agpr-copy-no-free-registers.ll
llvm/test/CodeGen/AMDGPU/mubuf-legalize-operands.ll
llvm/test/CodeGen/AMDGPU/spill-offset-calculation.ll
llvm/test/CodeGen/AMDGPU/wwm-reserved-spill.ll