This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU] Fix odd implicit operand handling in clause breaking
ClosedPublic

Authored by foad on May 19 2023, 2:37 AM.

Details

Summary

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)

Diff Detail

Event Timeline

foad created this revision.May 19 2023, 2:37 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 19 2023, 2:37 AM
foad requested review of this revision.May 19 2023, 2:37 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 19 2023, 2:37 AM
barannikov88 added inline comments.May 19 2023, 2:45 AM
llvm/lib/Target/AMDGPU/GCNHazardRecognizer.cpp
605

(nit) Could be inlined.

arsenm accepted this revision.May 19 2023, 11:15 AM
This revision is now accepted and ready to land.May 19 2023, 11:15 AM
This revision was landed with ongoing or failed builds.May 19 2023, 1:24 PM
This revision was automatically updated to reflect the committed changes.