1# RUN: llc -march=amdgcn -mcpu=gfx1010 -verify-machineinstrs -run-pass post-RA-hazard-rec -o - %s | FileCheck -check-prefix=GCN %s
2
3# GCN-LABEL: name: hazard_image_sample_d_buf_off6
4# GCN:      IMAGE_SAMPLE
5# GCN-NEXT: S_NOP 0
6# GCN-NEXT: BUFFER_LOAD_DWORD_OFFSET
7---
8name:            hazard_image_sample_d_buf_off6
9body:            |
10  bb.0:
11    $vgpr0_vgpr1_vgpr2_vgpr3 = IMAGE_SAMPLE_D_V4_V9_nsa_gfx10 undef $vgpr3, undef $vgpr8, undef $vgpr7, undef $vgpr5, undef $vgpr4, undef $vgpr6, undef $vgpr0, undef $vgpr2, undef $vgpr2, undef $sgpr0_sgpr1_sgpr2_sgpr3_sgpr4_sgpr5_sgpr6_sgpr7, undef $sgpr8_sgpr9_sgpr10_sgpr11, 15, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, implicit $exec  :: (load 16)
12    $vgpr1 = BUFFER_LOAD_DWORD_OFFSET undef $sgpr0_sgpr1_sgpr2_sgpr3, undef $sgpr4, 6, 0, 0, 0, 0, 0, implicit $exec
13...
14
15# GCN-LABEL: name: no_hazard_image_sample_d_buf_off1
16# GCN:      IMAGE_SAMPLE
17# GCN-NEXT: BUFFER_LOAD_DWORD_OFFSET
18---
19name:            no_hazard_image_sample_d_buf_off1
20body:            |
21  bb.0:
22    $vgpr0_vgpr1_vgpr2_vgpr3 = IMAGE_SAMPLE_D_V4_V9_nsa_gfx10 undef $vgpr3, undef $vgpr8, undef $vgpr7, undef $vgpr5, undef $vgpr4, undef $vgpr6, undef $vgpr0, undef $vgpr2, undef $vgpr2, undef $sgpr0_sgpr1_sgpr2_sgpr3_sgpr4_sgpr5_sgpr6_sgpr7, undef $sgpr8_sgpr9_sgpr10_sgpr11, 15, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, implicit $exec  :: (load 16)
23    $vgpr1 = BUFFER_LOAD_DWORD_OFFSET undef $sgpr0_sgpr1_sgpr2_sgpr3, undef $sgpr4, 1, 0, 0, 0, 0, 0, implicit $exec
24...
25
26# GCN-LABEL: name: no_hazard_image_sample_d_buf_far
27# GCN:      IMAGE_SAMPLE
28# GCN-NEXT: V_NOP_e32
29# GCN-NEXT: BUFFER_LOAD_DWORD_OFFSET
30---
31name:            no_hazard_image_sample_d_buf_far
32body:            |
33  bb.0:
34    $vgpr0_vgpr1_vgpr2_vgpr3 = IMAGE_SAMPLE_D_V4_V9_nsa_gfx10 undef $vgpr3, undef $vgpr8, undef $vgpr7, undef $vgpr5, undef $vgpr4, undef $vgpr6, undef $vgpr0, undef $vgpr2, undef $vgpr2, undef $sgpr0_sgpr1_sgpr2_sgpr3_sgpr4_sgpr5_sgpr6_sgpr7, undef $sgpr8_sgpr9_sgpr10_sgpr11, 15, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, implicit $exec  :: (load 16)
35    V_NOP_e32 implicit $exec
36    $vgpr1 = BUFFER_LOAD_DWORD_OFFSET undef $sgpr0_sgpr1_sgpr2_sgpr3, undef $sgpr4, 6, 0, 0, 0, 0, 0, implicit $exec
37...
38
39# Non-NSA
40# GCN-LABEL: name: no_hazard_image_sample_v4_v2_buf_off6
41# GCN:      IMAGE_SAMPLE
42# GCN-NEXT: BUFFER_LOAD_DWORD_OFFSET
43---
44name:            no_hazard_image_sample_v4_v2_buf_off6
45body:            |
46  bb.0:
47    $vgpr0_vgpr1_vgpr2_vgpr3 = IMAGE_SAMPLE_V4_V2_gfx10 undef $vgpr1_vgpr2, undef $sgpr0_sgpr1_sgpr2_sgpr3_sgpr4_sgpr5_sgpr6_sgpr7, undef $sgpr8_sgpr9_sgpr10_sgpr11, 15, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, implicit $exec  :: (load 16)
48    $vgpr1 = BUFFER_LOAD_DWORD_OFFSET undef $sgpr0_sgpr1_sgpr2_sgpr3, undef $sgpr4, 6, 0, 0, 0, 0, 0, implicit $exec
49...
50
51# Less than 4 dwords
52# GCN-LABEL: name: no_hazard_image_sample_v4_v3_buf_off6
53# GCN:      IMAGE_SAMPLE
54# GCN-NEXT: BUFFER_LOAD_DWORD_OFFSET
55---
56name:            no_hazard_image_sample_v4_v3_buf_off6
57body:            |
58  bb.0:
59    $vgpr0_vgpr1_vgpr2_vgpr3 = IMAGE_SAMPLE_V4_V3_nsa_gfx10 undef $vgpr1, undef $vgpr2, undef $vgpr0, undef $sgpr0_sgpr1_sgpr2_sgpr3_sgpr4_sgpr5_sgpr6_sgpr7, undef $sgpr8_sgpr9_sgpr10_sgpr11, 15, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, implicit $exec :: (load 16)
60    $vgpr1 = BUFFER_LOAD_DWORD_OFFSET undef $sgpr0_sgpr1_sgpr2_sgpr3, undef $sgpr4, 6, 0, 0, 0, 0, 0, implicit $exec
61...
62