1# RUN: llc -march=amdgcn -mcpu=gfx902 -verify-machineinstrs -run-pass  post-RA-hazard-rec %s -o - | FileCheck -check-prefixes=GCN,XNACK,GCX9 %s
2# RUN: llc -march=amdgcn -mcpu=gfx900 -verify-machineinstrs -run-pass  post-RA-hazard-rec %s -o - | FileCheck -check-prefixes=GCN,NOXNACK,GFX9 %s
3# RUN: llc -march=amdgcn -mcpu=gfx1010 -mattr=-wavefrontsize32,+wavefrontsize64 -verify-machineinstrs -run-pass  post-RA-hazard-rec %s -o - | FileCheck -check-prefixes=GCN,NOXNACK,GFX10 %s
4
5# GCN-LABEL: name: break_smem_clause_simple_load_smrd8_ptr_hidden_bundle
6# GCN: bb.0:
7# GCN:          }
8# XNACK-NEXT:   S_NOP
9# NOXNACK-NOT:  S_NOP
10# GCN:          S_LOAD_DWORDX2_IMM
11---
12name: break_smem_clause_simple_load_smrd8_ptr_hidden_bundle
13body: |
14  bb.0:
15    BUNDLE implicit-def $sgpr6_sgpr7 {
16      $sgpr10_sgpr11 = S_LOAD_DWORDX2_IMM $sgpr12_sgpr13, 0, 0, 0
17    }
18    $sgpr14_sgpr15 = S_LOAD_DWORDX2_IMM $sgpr10_sgpr11, 0, 0, 0
19    S_ENDPGM 0
20...
21
22# GFX9-LABEL: name: hazard_precedes_bundle
23# GFX9:      S_MOV_B32
24# GFX9-NEXT: S_NOP
25# GFX9:      BUNDLE
26# GFX9-NEXT: S_NOP
27---
28name: hazard_precedes_bundle
29body:	|
30  bb.0:
31    $m0 = S_MOV_B32 $sgpr7
32    S_SENDMSG 3, implicit $exec, implicit $m0
33    $m0 = S_MOV_B32 $sgpr8
34    BUNDLE implicit-def $vgpr0 {
35      $vgpr0 = V_INTERP_P1_F32 killed $vgpr4, 0, 0, implicit $mode, implicit $m0, implicit $exec
36    }
37    S_ENDPGM 0
38...
39
40# GCN-LABEL: name: vmem_vcc_hazard_ignore_bundle_instr
41# GCN:      S_LOAD_DWORDX2_IMM
42# GCN-NEXT: }
43# GCN-NEXT: S_NOP 3
44# GCN:      BUFFER_LOAD_DWORD_OFFEN
45---
46name: vmem_vcc_hazard_ignore_bundle_instr
47body: |
48  bb.0:
49    $sgpr0_sgpr1_sgpr2_sgpr3 = IMPLICIT_DEF
50    $vgpr0 = IMPLICIT_DEF
51    BUNDLE implicit-def $vgpr1, implicit $vgpr0, implicit $vgpr0, implicit-def $vcc, implicit $vcc, implicit $exec {
52      $vgpr1 = V_ADDC_U32_e32 $vgpr0, $vgpr0, implicit-def $vcc, implicit $vcc, implicit $exec
53    }
54    BUNDLE implicit-def $sgpr0_sgpr1, implicit $sgpr10_sgpr11 {
55      $sgpr0_sgpr1 = S_LOAD_DWORDX2_IMM $sgpr10_sgpr11, 0, 0, 0
56    }
57    $vgpr1 = BUFFER_LOAD_DWORD_OFFEN $vgpr0, $sgpr0_sgpr1_sgpr2_sgpr3, $vcc_lo, 0, 0, 0, 0, 0, 0, implicit $exec
58    S_ENDPGM 0
59...
60
61# GCN-LABEL: name: vmem_vcc_min_of_two_after_bundle
62# GCN:      bb.2:
63# GCN-NEXT: S_NOP 4
64# GCN-NEXT: BUFFER_LOAD_DWORD_OFFEN
65---
66name: vmem_vcc_min_of_two_after_bundle
67body: |
68  bb.0:
69    successors: %bb.2
70
71    BUNDLE implicit-def $vgpr1, implicit $vgpr0 {
72      $sgpr0_sgpr1_sgpr2_sgpr3 = IMPLICIT_DEF
73      $vgpr0 = IMPLICIT_DEF
74      $vgpr1 = V_ADDC_U32_e32 $vgpr0, $vgpr0, implicit-def $vcc, implicit $vcc, implicit $exec
75    }
76    S_NOP 0
77    S_BRANCH %bb.2
78
79  bb.1:
80    successors: %bb.2
81
82    BUNDLE implicit-def $vgpr1, implicit $vgpr0 {
83      $vgpr1 = V_ADDC_U32_e32 $vgpr0, $vgpr0, implicit-def $vcc, implicit $vcc, implicit $exec
84    }
85
86  bb.2:
87    $vgpr1 = BUFFER_LOAD_DWORD_OFFEN $vgpr0, $sgpr0_sgpr1_sgpr2_sgpr3, $vcc_lo, 0, 0, 0, 0, 0, 0, implicit $exec
88...
89