1# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2# RUN: llc -march=amdgcn -mcpu=gfx1010 -run-pass=machine-scheduler -o - %s | FileCheck %s
3# Make sure FP mode is not a hard scheduling boundary
4
5---
6name: denorm_mode_not_barrier
7tracksRegLiveness: true
8body: |
9  bb.0:
10    liveins: $vgpr0_vgpr1
11
12    ; CHECK-LABEL: name: denorm_mode_not_barrier
13    ; CHECK: liveins: $vgpr0_vgpr1
14    ; CHECK: [[COPY:%[0-9]+]]:vreg_64 = COPY $vgpr0_vgpr1
15    ; CHECK: [[GLOBAL_LOAD_DWORD:%[0-9]+]]:vgpr_32 = GLOBAL_LOAD_DWORD [[COPY]], 0, 0, 0, 0, implicit $exec :: (load 4)
16    ; CHECK: [[GLOBAL_LOAD_DWORD1:%[0-9]+]]:vgpr_32 = GLOBAL_LOAD_DWORD [[COPY]], 4, 0, 0, 0, implicit $exec :: (load 4)
17    ; CHECK: [[V_ADD_U32_e32_:%[0-9]+]]:vgpr_32 = V_ADD_U32_e32 [[GLOBAL_LOAD_DWORD]], [[GLOBAL_LOAD_DWORD1]], implicit $exec
18    ; CHECK: S_DENORM_MODE 0, implicit-def $mode, implicit $mode
19    ; CHECK: S_ENDPGM 0, implicit [[V_ADD_U32_e32_]]
20    %0:vreg_64 = COPY $vgpr0_vgpr1
21    %1:vgpr_32 = GLOBAL_LOAD_DWORD %0, 0, 0, 0, 0, implicit $exec :: (load 4)
22    S_DENORM_MODE 0, implicit-def $mode, implicit $mode
23    %2:vgpr_32 = GLOBAL_LOAD_DWORD %0, 4, 0, 0, 0, implicit $exec :: (load 4)
24    %3:vgpr_32 = V_ADD_U32_e32 %1, %2, implicit $exec
25    S_ENDPGM 0, implicit %3
26...
27
28---
29name: round_mode_not_barrier
30tracksRegLiveness: true
31body: |
32  bb.0:
33    liveins: $vgpr0_vgpr1
34
35    ; CHECK-LABEL: name: round_mode_not_barrier
36    ; CHECK: liveins: $vgpr0_vgpr1
37    ; CHECK: [[COPY:%[0-9]+]]:vreg_64 = COPY $vgpr0_vgpr1
38    ; CHECK: [[GLOBAL_LOAD_DWORD:%[0-9]+]]:vgpr_32 = GLOBAL_LOAD_DWORD [[COPY]], 0, 0, 0, 0, implicit $exec :: (load 4)
39    ; CHECK: [[GLOBAL_LOAD_DWORD1:%[0-9]+]]:vgpr_32 = GLOBAL_LOAD_DWORD [[COPY]], 4, 0, 0, 0, implicit $exec :: (load 4)
40    ; CHECK: [[V_ADD_U32_e32_:%[0-9]+]]:vgpr_32 = V_ADD_U32_e32 [[GLOBAL_LOAD_DWORD]], [[GLOBAL_LOAD_DWORD1]], implicit $exec
41    ; CHECK: S_ROUND_MODE 0, implicit-def $mode, implicit $mode
42    ; CHECK: S_ENDPGM 0, implicit [[V_ADD_U32_e32_]]
43    %0:vreg_64 = COPY $vgpr0_vgpr1
44    %1:vgpr_32 = GLOBAL_LOAD_DWORD %0, 0, 0, 0, 0, implicit $exec :: (load 4)
45    S_ROUND_MODE 0, implicit-def $mode, implicit $mode
46    %2:vgpr_32 = GLOBAL_LOAD_DWORD %0, 4, 0, 0, 0, implicit $exec :: (load 4)
47    %3:vgpr_32 = V_ADD_U32_e32 %1, %2, implicit $exec
48    S_ENDPGM 0, implicit %3
49...
50
51---
52name: denorm_mode_mode_def_use
53tracksRegLiveness: true
54body: |
55  bb.0:
56    liveins: $vgpr0_vgpr1
57
58    ; CHECK-LABEL: name: denorm_mode_mode_def_use
59    ; CHECK: liveins: $vgpr0_vgpr1
60    ; CHECK: [[COPY:%[0-9]+]]:vreg_64 = COPY $vgpr0_vgpr1
61    ; CHECK: [[GLOBAL_LOAD_DWORD:%[0-9]+]]:vgpr_32 = GLOBAL_LOAD_DWORD [[COPY]], 0, 0, 0, 0, implicit $exec :: (load 4)
62    ; CHECK: dead %3:vgpr_32 = GLOBAL_LOAD_DWORD [[COPY]], 4, 0, 0, 0, implicit $exec :: (load 4)
63    ; CHECK: S_DENORM_MODE 0, implicit-def $mode, implicit $mode
64    ; CHECK: [[V_ADD_F32_e32_:%[0-9]+]]:vgpr_32 = V_ADD_F32_e32 0, [[GLOBAL_LOAD_DWORD]], implicit $mode, implicit $exec
65    ; CHECK: [[V_ADD_U32_e32_:%[0-9]+]]:vgpr_32 = V_ADD_U32_e32 [[GLOBAL_LOAD_DWORD]], [[V_ADD_F32_e32_]], implicit $exec
66    ; CHECK: S_ENDPGM 0, implicit [[V_ADD_F32_e32_]], implicit [[V_ADD_U32_e32_]]
67    %0:vreg_64 = COPY $vgpr0_vgpr1
68    %1:vgpr_32 = GLOBAL_LOAD_DWORD %0, 0, 0, 0, 0, implicit $exec :: (load 4)
69    S_DENORM_MODE 0, implicit-def $mode, implicit $mode
70    %2:vgpr_32 = V_ADD_F32_e32 0, %1, implicit $mode, implicit $exec
71    %3:vgpr_32 = GLOBAL_LOAD_DWORD %0, 4, 0, 0, 0, implicit $exec :: (load 4)
72    %4:vgpr_32 = V_ADD_U32_e32 %1, %2, implicit $exec
73    S_ENDPGM 0, implicit %2, implicit %4
74...
75
76---
77name: round_mode_mode_def_use
78tracksRegLiveness: true
79body: |
80  bb.0:
81    liveins: $vgpr0_vgpr1
82
83    ; CHECK-LABEL: name: round_mode_mode_def_use
84    ; CHECK: liveins: $vgpr0_vgpr1
85    ; CHECK: [[COPY:%[0-9]+]]:vreg_64 = COPY $vgpr0_vgpr1
86    ; CHECK: [[GLOBAL_LOAD_DWORD:%[0-9]+]]:vgpr_32 = GLOBAL_LOAD_DWORD [[COPY]], 0, 0, 0, 0, implicit $exec :: (load 4)
87    ; CHECK: dead %3:vgpr_32 = GLOBAL_LOAD_DWORD [[COPY]], 4, 0, 0, 0, implicit $exec :: (load 4)
88    ; CHECK: S_ROUND_MODE 0, implicit-def $mode, implicit $mode
89    ; CHECK: [[V_ADD_F32_e32_:%[0-9]+]]:vgpr_32 = V_ADD_F32_e32 0, [[GLOBAL_LOAD_DWORD]], implicit $mode, implicit $exec
90    ; CHECK: [[V_ADD_U32_e32_:%[0-9]+]]:vgpr_32 = V_ADD_U32_e32 [[GLOBAL_LOAD_DWORD]], [[V_ADD_F32_e32_]], implicit $exec
91    ; CHECK: S_ENDPGM 0, implicit [[V_ADD_F32_e32_]], implicit [[V_ADD_U32_e32_]]
92    %0:vreg_64 = COPY $vgpr0_vgpr1
93    %1:vgpr_32 = GLOBAL_LOAD_DWORD %0, 0, 0, 0, 0, implicit $exec :: (load 4)
94    S_ROUND_MODE 0, implicit-def $mode, implicit $mode
95    %2:vgpr_32 = V_ADD_F32_e32 0, %1, implicit $mode, implicit $exec
96    %3:vgpr_32 = GLOBAL_LOAD_DWORD %0, 4, 0, 0, 0, implicit $exec :: (load 4)
97    %4:vgpr_32 = V_ADD_U32_e32 %1, %2, implicit $exec
98    S_ENDPGM 0, implicit %2, implicit %4
99...
100