[clang] Fix crashes when passing VLA to va_arg (#119563)
[llvm-project.git] / llvm / test / CodeGen / AMDGPU / hazard-hidden-bundle.mir
blobe2635fc6ecbbb5acad4148c717745f3af2fe39d2
1 # RUN: llc -mtriple=amdgcn -mcpu=gfx902 -mattr=+xnack -verify-machineinstrs -run-pass  post-RA-hazard-rec %s -o - | FileCheck -check-prefixes=GCN,XNACK,GFX9 %s
2 # RUN: llc -mtriple=amdgcn -mcpu=gfx900 -mattr=-xnack -verify-machineinstrs -run-pass  post-RA-hazard-rec %s -o - | FileCheck -check-prefixes=GCN,NOXNACK,GFX9 %s
3 # RUN: llc -mtriple=amdgcn -mcpu=gfx1010 -mattr=+wavefrontsize64,-xnack -verify-machineinstrs -run-pass  post-RA-hazard-rec %s -o - | FileCheck -check-prefixes=GCN,NOXNACK %s
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 ---
12 name: break_smem_clause_simple_load_smrd8_ptr_hidden_bundle
13 body: |
14   bb.0:
15     BUNDLE implicit-def $sgpr6_sgpr7 {
16       $sgpr10_sgpr11 = S_LOAD_DWORDX2_IMM $sgpr12_sgpr13, 0, 0
17     }
18     $sgpr14_sgpr15 = S_LOAD_DWORDX2_IMM $sgpr10_sgpr11, 0, 0
19     S_ENDPGM 0
20 ...
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 ---
28 name: hazard_precedes_bundle
29 body:   |
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 ...
40 # GCN-LABEL: name: vmem_vcc_hazard_ignore_bundle_instr
41 # GCN:      S_LOAD_DWORDX2_IMM
42 # GCN-NEXT: }
43 # GFX9-NEXT: S_NOP 3
44 # GCN:      BUFFER_LOAD_DWORD_OFFEN
45 ---
46 name: vmem_vcc_hazard_ignore_bundle_instr
47 body: |
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
56     }
57     $vgpr1 = BUFFER_LOAD_DWORD_OFFEN $vgpr0, $sgpr0_sgpr1_sgpr2_sgpr3, $vcc_lo, 0, 0, 0, implicit $exec
58     S_ENDPGM 0
59 ...
61 # GCN-LABEL: name: vmem_vcc_min_of_two_after_bundle
62 # GCN:      bb.2:
63 # GFX9-NEXT: S_NOP 4
64 # GCN-NEXT: BUFFER_LOAD_DWORD_OFFEN
65 ---
66 name: vmem_vcc_min_of_two_after_bundle
67 body: |
68   bb.0:
69     successors: %bb.2
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
79   bb.1:
80     successors: %bb.2
82     BUNDLE implicit-def $vgpr1, implicit $vgpr0 {
83       $vgpr1 = V_ADDC_U32_e32 $vgpr0, $vgpr0, implicit-def $vcc, implicit $vcc, implicit $exec
84     }
86   bb.2:
87     $vgpr1 = BUFFER_LOAD_DWORD_OFFEN $vgpr0, $sgpr0_sgpr1_sgpr2_sgpr3, $vcc_lo, 0, 0, 0, implicit $exec
88 ...