Skip to content

[AMDGPU] Cluster export instruction in PostRA Scheduler #141399

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1129,6 +1129,7 @@ GCNTargetMachine::createPostMachineScheduler(MachineSchedContext *C) const {
getOptLevel() >= CodeGenOptLevel::Less) &&
EnableVOPD)
DAG->addMutation(createVOPDPairingMutation());
DAG->addMutation(createAMDGPUExportClusteringDAGMutation());
return DAG;
}
//===----------------------------------------------------------------------===//
Expand Down
46 changes: 46 additions & 0 deletions llvm/test/CodeGen/AMDGPU/export-cluster-postra.mir
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py UTC_ARGS: --version 5
# RUN: llc -mtriple=amdgcn -mcpu=gfx1100 -passes=postmisched %s -o - | FileCheck %s

--- |
define amdgpu_ps void @export_cluster_postra() {
ret void
}
...
---

---
name: export_cluster_postra
body: |
bb.0:
liveins: $vgpr0, $vgpr1, $vgpr2, $vgpr3, $sgpr4, $vgpr5, $vgpr6, $sgpr8_sgpr9_sgpr10_sgpr11

; CHECK-LABEL: name: export_cluster_postra
; CHECK: liveins: $vgpr0, $vgpr1, $vgpr2, $vgpr3, $sgpr4, $vgpr5, $vgpr6, $sgpr8_sgpr9_sgpr10_sgpr11
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: BUNDLE implicit-def $sgpr0, implicit-def $sgpr1, implicit killed $sgpr8_sgpr9_sgpr10_sgpr11 {
; CHECK-NEXT: $sgpr0 = S_BUFFER_LOAD_DWORD_IMM $sgpr8_sgpr9_sgpr10_sgpr11, 20, 0 :: (dereferenceable invariant load (s32))
; CHECK-NEXT: $sgpr1 = S_BUFFER_LOAD_DWORD_IMM killed $sgpr8_sgpr9_sgpr10_sgpr11, 28, 0 :: (dereferenceable invariant load (s32))
; CHECK-NEXT: }
; CHECK-NEXT: $vgpr6 = nofpexcept V_CVT_PKRTZ_F16_F32_e64 0, killed $vgpr6, 0, 1065353216, 0, 0, implicit $mode, implicit $exec
; CHECK-NEXT: $vgpr5 = nofpexcept V_CVT_PKRTZ_F16_F32_e64 0, killed $vgpr5, 0, 1065353216, 0, 0, implicit $mode, implicit $exec
; CHECK-NEXT: $vgpr7 = nnan nsz arcp contract afn reassoc nofpexcept V_MUL_F32_e32 killed $sgpr0, $vgpr2, implicit $mode, implicit $exec
; CHECK-NEXT: $vgpr2 = nnan nsz arcp contract afn reassoc nofpexcept V_ADD_F32_e64 0, killed $vgpr2, 0, killed $sgpr1, 1, 0, implicit $mode, implicit $exec
; CHECK-NEXT: $vgpr3 = nofpexcept V_CVT_PKRTZ_F16_F32_e32 killed $vgpr7, killed $vgpr3, implicit $mode, implicit $exec
; CHECK-NEXT: $vgpr2 = nofpexcept V_CVT_PKRTZ_F16_F32_e32 killed $vgpr4, killed $vgpr2, implicit $mode, implicit $exec
; CHECK-NEXT: EXP 0, killed $vgpr0, killed $vgpr6, undef $vgpr0, undef $vgpr0, -1, 0, 3, implicit $exec
; CHECK-NEXT: EXP 1, killed $vgpr1, killed $vgpr5, undef $vgpr0, undef $vgpr0, -1, 0, 3, implicit $exec
; CHECK-NEXT: EXP_DONE 2, killed $vgpr3, killed $vgpr2, undef $vgpr0, undef $vgpr0, -1, 0, 3, implicit $exec
BUNDLE implicit-def $sgpr0, implicit-def $sgpr1, implicit $sgpr8_sgpr9_sgpr10_sgpr11 {
$sgpr0 = S_BUFFER_LOAD_DWORD_IMM $sgpr8_sgpr9_sgpr10_sgpr11, 20, 0 :: (dereferenceable invariant load (s32))
$sgpr1 = S_BUFFER_LOAD_DWORD_IMM $sgpr8_sgpr9_sgpr10_sgpr11, 28, 0 :: (dereferenceable invariant load (s32))
}
$vgpr6 = nofpexcept V_CVT_PKRTZ_F16_F32_e64 0, $vgpr6, 0, 1065353216, 0, 0, implicit $mode, implicit $exec
$vgpr5 = nofpexcept V_CVT_PKRTZ_F16_F32_e64 0, $vgpr5, 0, 1065353216, 0, 0, implicit $mode, implicit $exec
$vgpr7 = nnan nsz arcp contract afn reassoc nofpexcept V_MUL_F32_e32 $sgpr0, $vgpr2, implicit $mode, implicit $exec
$vgpr3 = nofpexcept V_CVT_PKRTZ_F16_F32_e32 $vgpr7, $vgpr3, implicit $mode, implicit $exec
$vgpr2 = nnan nsz arcp contract afn reassoc nofpexcept V_ADD_F32_e64 0, $vgpr2, 0, $sgpr1, 1, 0, implicit $mode, implicit $exec
$vgpr2 = nofpexcept V_CVT_PKRTZ_F16_F32_e32 $vgpr4, $vgpr2, implicit $mode, implicit $exec
EXP 0, $vgpr0, $vgpr6, undef $vgpr0, undef $vgpr0, -1, 0, 3, implicit $exec
EXP 1, $vgpr1, $vgpr5, undef $vgpr0, undef $vgpr0, -1, 0, 3, implicit $exec
EXP_DONE 2, $vgpr3, $vgpr2, undef $vgpr0, undef $vgpr0, -1, 0, 3, implicit $exec
...