# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py UTC_ARGS: --version 6 # RUN: llc -mtriple=amdgcn -mcpu=gfx1200 -verify-machineinstrs -run-pass si-insert-waitcnts -o - %s | FileCheck %s # Checks that the WaitcntGenerator updates its behavior when we switch MFs # with different attributes. # There are 2 pairs of functions, each testing an attribute: # The first pair is testing amdgpu-expert-scheduling-mode # and the second is testing target-cpu # # In each function pair the function bodies are identical and the only # difference is the attribute. --- | define amdgpu_kernel void @test-wcg-attributes-noexpert() #0 { ret void } define amdgpu_kernel void @test-wcg-attributes-expert() #1 { ret void } define amdgpu_kernel void @test-wcg-attributes-gfx900() #2 { ret void } define amdgpu_kernel void @test-wcg-attributes-gfx1200() #3 { ret void } attributes #0 = { "amdgpu-expert-scheduling-mode"="false" } attributes #1 = { "amdgpu-expert-scheduling-mode"="true" } attributes #2 = { "target-cpu"="gfx900" } attributes #3 = { "target-cpu"="gfx1200" } ... --- name: test-wcg-attributes-noexpert body: | bb.0: ; CHECK-LABEL: name: test-wcg-attributes-noexpert ; CHECK: S_WAIT_LOADCNT_DSCNT 0 ; CHECK-NEXT: S_WAIT_EXPCNT 0 ; CHECK-NEXT: S_WAIT_SAMPLECNT 0 ; CHECK-NEXT: S_WAIT_BVHCNT 0 ; CHECK-NEXT: S_WAIT_KMCNT 0 ; CHECK-NEXT: $vgpr1 = nofpexcept V_EXP_F32_e32 $vgpr0, implicit $mode, implicit $exec ; CHECK-NEXT: $vgpr0_vgpr1_vgpr2_vgpr3 = DS_READ_B128_gfx9 renamable $vgpr36, 8224, 0, implicit $exec ; CHECK-NEXT: S_ENDPGM 0 $vgpr1 = nofpexcept V_EXP_F32_e32 $vgpr0, implicit $mode, implicit $exec $vgpr0_vgpr1_vgpr2_vgpr3 = DS_READ_B128_gfx9 renamable $vgpr36, 8224, 0, implicit $exec S_ENDPGM 0 ... --- name: test-wcg-attributes-expert body: | bb.0: ; CHECK-LABEL: name: test-wcg-attributes-expert ; CHECK: S_SETREG_IMM32_B32 2, 2074, implicit-def $mode, implicit $mode ; CHECK-NEXT: S_WAIT_LOADCNT_DSCNT 0 ; CHECK-NEXT: S_WAIT_EXPCNT 0 ; CHECK-NEXT: S_WAIT_SAMPLECNT 0 ; CHECK-NEXT: S_WAIT_BVHCNT 0 ; CHECK-NEXT: S_WAIT_KMCNT 0 ; CHECK-NEXT: $vgpr1 = nofpexcept V_EXP_F32_e32 $vgpr0, implicit $mode, implicit $exec ; CHECK-NEXT: S_WAITCNT_DEPCTR .VaVdst_0 ; CHECK-NEXT: $vgpr0_vgpr1_vgpr2_vgpr3 = DS_READ_B128_gfx9 renamable $vgpr36, 8224, 0, implicit $exec ; CHECK-NEXT: S_ENDPGM 0 $vgpr1 = nofpexcept V_EXP_F32_e32 $vgpr0, implicit $mode, implicit $exec $vgpr0_vgpr1_vgpr2_vgpr3 = DS_READ_B128_gfx9 renamable $vgpr36, 8224, 0, implicit $exec S_ENDPGM 0 ... --- name: test-wcg-attributes-gfx900 body: | bb.0: ; CHECK-LABEL: name: test-wcg-attributes-gfx900 ; CHECK: S_WAITCNT .Vmcnt_0_Expcnt_0_Lgkmcnt_0 ; CHECK-NEXT: $vgpr1 = nofpexcept V_EXP_F32_e32 $vgpr0, implicit $mode, implicit $exec ; CHECK-NEXT: $vgpr0_vgpr1_vgpr2_vgpr3 = DS_READ_B128_gfx9 renamable $vgpr36, 8224, 0, implicit $exec ; CHECK-NEXT: S_ENDPGM 0 $vgpr1 = nofpexcept V_EXP_F32_e32 $vgpr0, implicit $mode, implicit $exec $vgpr0_vgpr1_vgpr2_vgpr3 = DS_READ_B128_gfx9 renamable $vgpr36, 8224, 0, implicit $exec S_ENDPGM 0 ... --- name: test-wcg-attributes-gfx1200 body: | bb.0: ; CHECK-LABEL: name: test-wcg-attributes-gfx1200 ; CHECK: S_WAIT_LOADCNT_DSCNT 0 ; CHECK-NEXT: S_WAIT_EXPCNT 0 ; CHECK-NEXT: S_WAIT_SAMPLECNT 0 ; CHECK-NEXT: S_WAIT_BVHCNT 0 ; CHECK-NEXT: S_WAIT_KMCNT 0 ; CHECK-NEXT: $vgpr1 = nofpexcept V_EXP_F32_e32 $vgpr0, implicit $mode, implicit $exec ; CHECK-NEXT: $vgpr0_vgpr1_vgpr2_vgpr3 = DS_READ_B128_gfx9 renamable $vgpr36, 8224, 0, implicit $exec ; CHECK-NEXT: S_ENDPGM 0 $vgpr1 = nofpexcept V_EXP_F32_e32 $vgpr0, implicit $mode, implicit $exec $vgpr0_vgpr1_vgpr2_vgpr3 = DS_READ_B128_gfx9 renamable $vgpr36, 8224, 0, implicit $exec S_ENDPGM 0 ...