brintos

brintos / llvm-project-archived public Read only

0
0
Text · 127.6 KiB · 8b60aa0 Raw
2767 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py2; RUN: llc -mtriple=amdgcn -mcpu=verde < %s | FileCheck -check-prefixes=VERDE %s3; RUN: llc -mtriple=amdgcn -mcpu=gfx900 < %s | FileCheck -check-prefixes=GFX6789 %s4; RUN: llc -mtriple=amdgcn -mcpu=gfx9-generic --amdhsa-code-object-version=6 < %s | FileCheck -check-prefixes=GFX6789 %s5; RUN: llc -mtriple=amdgcn -mcpu=gfx1010 < %s | FileCheck -check-prefixes=GFX10PLUS,GFX10 %s6; RUN: llc -mtriple=amdgcn -mcpu=gfx10-1-generic --amdhsa-code-object-version=6 < %s | FileCheck -check-prefixes=GFX10PLUS,GFX10 %s7; RUN: llc -mtriple=amdgcn -mcpu=gfx1100 -amdgpu-enable-delay-alu=0 < %s | FileCheck -check-prefixes=GFX10PLUS,GFX11 %s8; RUN: llc -mtriple=amdgcn -mcpu=gfx11-generic --amdhsa-code-object-version=6 -amdgpu-enable-delay-alu=0 < %s | FileCheck -check-prefixes=GFX10PLUS,GFX11 %s9; RUN: llc -mtriple=amdgcn -mcpu=gfx1200 -amdgpu-enable-delay-alu=0 < %s | FileCheck -check-prefixes=GFX12 %s10 11define amdgpu_ps <4 x float> @sample_1d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %s) {12; VERDE-LABEL: sample_1d:13; VERDE:       ; %bb.0: ; %main_body14; VERDE-NEXT:    s_mov_b64 s[12:13], exec15; VERDE-NEXT:    s_wqm_b64 exec, exec16; VERDE-NEXT:    s_and_b64 exec, exec, s[12:13]17; VERDE-NEXT:    image_sample v[0:3], v0, s[0:7], s[8:11] dmask:0xf18; VERDE-NEXT:    s_waitcnt vmcnt(0)19; VERDE-NEXT:    ; return to shader part epilog20;21; GFX6789-LABEL: sample_1d:22; GFX6789:       ; %bb.0: ; %main_body23; GFX6789-NEXT:    s_mov_b64 s[12:13], exec24; GFX6789-NEXT:    s_wqm_b64 exec, exec25; GFX6789-NEXT:    s_and_b64 exec, exec, s[12:13]26; GFX6789-NEXT:    image_sample v[0:3], v0, s[0:7], s[8:11] dmask:0xf27; GFX6789-NEXT:    s_waitcnt vmcnt(0)28; GFX6789-NEXT:    ; return to shader part epilog29;30; GFX10PLUS-LABEL: sample_1d:31; GFX10PLUS:       ; %bb.0: ; %main_body32; GFX10PLUS-NEXT:    s_mov_b32 s12, exec_lo33; GFX10PLUS-NEXT:    s_wqm_b32 exec_lo, exec_lo34; GFX10PLUS-NEXT:    s_and_b32 exec_lo, exec_lo, s1235; GFX10PLUS-NEXT:    image_sample v[0:3], v0, s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_1D36; GFX10PLUS-NEXT:    s_waitcnt vmcnt(0)37; GFX10PLUS-NEXT:    ; return to shader part epilog38;39; GFX12-LABEL: sample_1d:40; GFX12:       ; %bb.0: ; %main_body41; GFX12-NEXT:    s_mov_b32 s12, exec_lo42; GFX12-NEXT:    s_wqm_b32 exec_lo, exec_lo43; GFX12-NEXT:    s_and_b32 exec_lo, exec_lo, s1244; GFX12-NEXT:    image_sample v[0:3], v0, s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_1D45; GFX12-NEXT:    s_wait_samplecnt 0x046; GFX12-NEXT:    ; return to shader part epilog47main_body:48  %v = call <4 x float> @llvm.amdgcn.image.sample.1d.v4f32.f32(i32 15, float %s, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)49  ret <4 x float> %v50}51 52define amdgpu_ps <4 x float> @sample_1d_tfe(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, ptr addrspace(1) inreg %out, float %s) {53; VERDE-LABEL: sample_1d_tfe:54; VERDE:       ; %bb.0: ; %main_body55; VERDE-NEXT:    s_mov_b64 s[14:15], exec56; VERDE-NEXT:    s_wqm_b64 exec, exec57; VERDE-NEXT:    v_mov_b32_e32 v5, v058; VERDE-NEXT:    v_mov_b32_e32 v0, 059; VERDE-NEXT:    v_mov_b32_e32 v1, v060; VERDE-NEXT:    v_mov_b32_e32 v2, v061; VERDE-NEXT:    v_mov_b32_e32 v3, v062; VERDE-NEXT:    v_mov_b32_e32 v4, v063; VERDE-NEXT:    s_and_b64 exec, exec, s[14:15]64; VERDE-NEXT:    image_sample v[0:4], v5, s[0:7], s[8:11] dmask:0xf tfe65; VERDE-NEXT:    s_mov_b32 s15, 0xf00066; VERDE-NEXT:    s_mov_b32 s14, -167; VERDE-NEXT:    s_waitcnt vmcnt(0)68; VERDE-NEXT:    buffer_store_dword v4, off, s[12:15], 069; VERDE-NEXT:    s_waitcnt vmcnt(0) expcnt(0)70; VERDE-NEXT:    ; return to shader part epilog71;72; GFX6789-LABEL: sample_1d_tfe:73; GFX6789:       ; %bb.0: ; %main_body74; GFX6789-NEXT:    s_mov_b64 s[14:15], exec75; GFX6789-NEXT:    s_wqm_b64 exec, exec76; GFX6789-NEXT:    v_mov_b32_e32 v6, 077; GFX6789-NEXT:    v_mov_b32_e32 v5, v078; GFX6789-NEXT:    v_mov_b32_e32 v7, v679; GFX6789-NEXT:    v_mov_b32_e32 v8, v680; GFX6789-NEXT:    v_mov_b32_e32 v9, v681; GFX6789-NEXT:    v_mov_b32_e32 v10, v682; GFX6789-NEXT:    v_mov_b32_e32 v0, v683; GFX6789-NEXT:    v_mov_b32_e32 v1, v784; GFX6789-NEXT:    v_mov_b32_e32 v2, v885; GFX6789-NEXT:    v_mov_b32_e32 v3, v986; GFX6789-NEXT:    v_mov_b32_e32 v4, v1087; GFX6789-NEXT:    s_and_b64 exec, exec, s[14:15]88; GFX6789-NEXT:    image_sample v[0:4], v5, s[0:7], s[8:11] dmask:0xf tfe89; GFX6789-NEXT:    s_waitcnt vmcnt(0)90; GFX6789-NEXT:    global_store_dword v6, v4, s[12:13]91; GFX6789-NEXT:    s_waitcnt vmcnt(0)92; GFX6789-NEXT:    ; return to shader part epilog93;94; GFX10-LABEL: sample_1d_tfe:95; GFX10:       ; %bb.0: ; %main_body96; GFX10-NEXT:    s_mov_b32 s14, exec_lo97; GFX10-NEXT:    s_wqm_b32 exec_lo, exec_lo98; GFX10-NEXT:    v_mov_b32_e32 v6, 099; GFX10-NEXT:    v_mov_b32_e32 v5, v0100; GFX10-NEXT:    v_mov_b32_e32 v7, v6101; GFX10-NEXT:    v_mov_b32_e32 v8, v6102; GFX10-NEXT:    v_mov_b32_e32 v9, v6103; GFX10-NEXT:    v_mov_b32_e32 v10, v6104; GFX10-NEXT:    v_mov_b32_e32 v0, v6105; GFX10-NEXT:    v_mov_b32_e32 v1, v7106; GFX10-NEXT:    v_mov_b32_e32 v2, v8107; GFX10-NEXT:    v_mov_b32_e32 v3, v9108; GFX10-NEXT:    v_mov_b32_e32 v4, v10109; GFX10-NEXT:    s_and_b32 exec_lo, exec_lo, s14110; GFX10-NEXT:    image_sample v[0:4], v5, s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_1D tfe111; GFX10-NEXT:    s_waitcnt vmcnt(0)112; GFX10-NEXT:    global_store_dword v6, v4, s[12:13]113; GFX10-NEXT:    ; return to shader part epilog114;115; GFX11-LABEL: sample_1d_tfe:116; GFX11:       ; %bb.0: ; %main_body117; GFX11-NEXT:    s_mov_b32 s14, exec_lo118; GFX11-NEXT:    s_wqm_b32 exec_lo, exec_lo119; GFX11-NEXT:    v_dual_mov_b32 v5, v0 :: v_dual_mov_b32 v6, 0120; GFX11-NEXT:    v_mov_b32_e32 v7, v6121; GFX11-NEXT:    v_mov_b32_e32 v8, v6122; GFX11-NEXT:    v_mov_b32_e32 v9, v6123; GFX11-NEXT:    v_mov_b32_e32 v10, v6124; GFX11-NEXT:    v_dual_mov_b32 v0, v6 :: v_dual_mov_b32 v1, v7125; GFX11-NEXT:    v_dual_mov_b32 v2, v8 :: v_dual_mov_b32 v3, v9126; GFX11-NEXT:    v_mov_b32_e32 v4, v10127; GFX11-NEXT:    s_and_b32 exec_lo, exec_lo, s14128; GFX11-NEXT:    image_sample v[0:4], v5, s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_1D tfe129; GFX11-NEXT:    s_waitcnt vmcnt(0)130; GFX11-NEXT:    global_store_b32 v6, v4, s[12:13]131; GFX11-NEXT:    ; return to shader part epilog132;133; GFX12-LABEL: sample_1d_tfe:134; GFX12:       ; %bb.0: ; %main_body135; GFX12-NEXT:    s_mov_b32 s14, exec_lo136; GFX12-NEXT:    s_wqm_b32 exec_lo, exec_lo137; GFX12-NEXT:    v_dual_mov_b32 v5, v0 :: v_dual_mov_b32 v6, 0138; GFX12-NEXT:    v_dual_mov_b32 v7, v6 :: v_dual_mov_b32 v8, v6139; GFX12-NEXT:    v_dual_mov_b32 v9, v6 :: v_dual_mov_b32 v10, v6140; GFX12-NEXT:    v_dual_mov_b32 v0, v6 :: v_dual_mov_b32 v1, v7141; GFX12-NEXT:    v_dual_mov_b32 v2, v8 :: v_dual_mov_b32 v3, v9142; GFX12-NEXT:    v_mov_b32_e32 v4, v10143; GFX12-NEXT:    s_and_b32 exec_lo, exec_lo, s14144; GFX12-NEXT:    image_sample v[0:4], v5, s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_1D tfe145; GFX12-NEXT:    s_wait_samplecnt 0x0146; GFX12-NEXT:    global_store_b32 v6, v4, s[12:13]147; GFX12-NEXT:    ; return to shader part epilog148main_body:149  %v = call {<4 x float>,i32} @llvm.amdgcn.image.sample.1d.v4f32i32.f32(i32 15, float %s, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 1, i32 0)150  %v.vec = extractvalue {<4 x float>, i32} %v, 0151  %v.err = extractvalue {<4 x float>, i32} %v, 1152  store i32 %v.err, ptr addrspace(1) %out, align 4153  ret <4 x float> %v.vec154}155 156define amdgpu_ps <2 x float> @sample_1d_tfe_adjust_writemask_1(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, ptr addrspace(1) inreg %out, float %s) {157; VERDE-LABEL: sample_1d_tfe_adjust_writemask_1:158; VERDE:       ; %bb.0: ; %main_body159; VERDE-NEXT:    s_mov_b64 s[12:13], exec160; VERDE-NEXT:    s_wqm_b64 exec, exec161; VERDE-NEXT:    v_mov_b32_e32 v2, v0162; VERDE-NEXT:    v_mov_b32_e32 v0, 0163; VERDE-NEXT:    v_mov_b32_e32 v1, v0164; VERDE-NEXT:    s_and_b64 exec, exec, s[12:13]165; VERDE-NEXT:    image_sample v[0:1], v2, s[0:7], s[8:11] dmask:0x1 tfe166; VERDE-NEXT:    s_waitcnt vmcnt(0)167; VERDE-NEXT:    ; return to shader part epilog168;169; GFX6789-LABEL: sample_1d_tfe_adjust_writemask_1:170; GFX6789:       ; %bb.0: ; %main_body171; GFX6789-NEXT:    s_mov_b64 s[12:13], exec172; GFX6789-NEXT:    s_wqm_b64 exec, exec173; GFX6789-NEXT:    v_mov_b32_e32 v2, v0174; GFX6789-NEXT:    v_mov_b32_e32 v0, 0175; GFX6789-NEXT:    v_mov_b32_e32 v1, v0176; GFX6789-NEXT:    s_and_b64 exec, exec, s[12:13]177; GFX6789-NEXT:    image_sample v[0:1], v2, s[0:7], s[8:11] dmask:0x1 tfe178; GFX6789-NEXT:    s_waitcnt vmcnt(0)179; GFX6789-NEXT:    ; return to shader part epilog180;181; GFX10PLUS-LABEL: sample_1d_tfe_adjust_writemask_1:182; GFX10PLUS:       ; %bb.0: ; %main_body183; GFX10PLUS-NEXT:    s_mov_b32 s12, exec_lo184; GFX10PLUS-NEXT:    s_wqm_b32 exec_lo, exec_lo185; GFX10PLUS-NEXT:    v_mov_b32_e32 v2, v0186; GFX10PLUS-NEXT:    v_mov_b32_e32 v0, 0187; GFX10PLUS-NEXT:    v_mov_b32_e32 v1, v0188; GFX10PLUS-NEXT:    s_and_b32 exec_lo, exec_lo, s12189; GFX10PLUS-NEXT:    image_sample v[0:1], v2, s[0:7], s[8:11] dmask:0x1 dim:SQ_RSRC_IMG_1D tfe190; GFX10PLUS-NEXT:    s_waitcnt vmcnt(0)191; GFX10PLUS-NEXT:    ; return to shader part epilog192;193; GFX12-LABEL: sample_1d_tfe_adjust_writemask_1:194; GFX12:       ; %bb.0: ; %main_body195; GFX12-NEXT:    s_mov_b32 s12, exec_lo196; GFX12-NEXT:    s_wqm_b32 exec_lo, exec_lo197; GFX12-NEXT:    v_mov_b32_e32 v2, v0198; GFX12-NEXT:    v_mov_b32_e32 v0, 0199; GFX12-NEXT:    v_mov_b32_e32 v1, v0200; GFX12-NEXT:    s_and_b32 exec_lo, exec_lo, s12201; GFX12-NEXT:    image_sample v[0:1], v2, s[0:7], s[8:11] dmask:0x1 dim:SQ_RSRC_IMG_1D tfe202; GFX12-NEXT:    s_wait_samplecnt 0x0203; GFX12-NEXT:    ; return to shader part epilog204main_body:205  %v = call {<4 x float>,i32} @llvm.amdgcn.image.sample.1d.v4f32i32.f32(i32 15, float %s, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 1, i32 0)206  %res.vec = extractvalue {<4 x float>,i32} %v, 0207  %res.f = extractelement <4 x float> %res.vec, i32 0208  %res.err = extractvalue {<4 x float>,i32} %v, 1209  %res.errf = bitcast i32 %res.err to float210  %res.tmp = insertelement <2 x float> poison, float %res.f, i32 0211  %res = insertelement <2 x float> %res.tmp, float %res.errf, i32 1212  ret <2 x float> %res213}214 215define amdgpu_ps <2 x float> @sample_1d_tfe_adjust_writemask_2(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %s) {216; VERDE-LABEL: sample_1d_tfe_adjust_writemask_2:217; VERDE:       ; %bb.0: ; %main_body218; VERDE-NEXT:    s_mov_b64 s[12:13], exec219; VERDE-NEXT:    s_wqm_b64 exec, exec220; VERDE-NEXT:    v_mov_b32_e32 v2, v0221; VERDE-NEXT:    v_mov_b32_e32 v0, 0222; VERDE-NEXT:    v_mov_b32_e32 v1, v0223; VERDE-NEXT:    s_and_b64 exec, exec, s[12:13]224; VERDE-NEXT:    image_sample v[0:1], v2, s[0:7], s[8:11] dmask:0x2 tfe225; VERDE-NEXT:    s_waitcnt vmcnt(0)226; VERDE-NEXT:    ; return to shader part epilog227;228; GFX6789-LABEL: sample_1d_tfe_adjust_writemask_2:229; GFX6789:       ; %bb.0: ; %main_body230; GFX6789-NEXT:    s_mov_b64 s[12:13], exec231; GFX6789-NEXT:    s_wqm_b64 exec, exec232; GFX6789-NEXT:    v_mov_b32_e32 v2, v0233; GFX6789-NEXT:    v_mov_b32_e32 v0, 0234; GFX6789-NEXT:    v_mov_b32_e32 v1, v0235; GFX6789-NEXT:    s_and_b64 exec, exec, s[12:13]236; GFX6789-NEXT:    image_sample v[0:1], v2, s[0:7], s[8:11] dmask:0x2 tfe237; GFX6789-NEXT:    s_waitcnt vmcnt(0)238; GFX6789-NEXT:    ; return to shader part epilog239;240; GFX10PLUS-LABEL: sample_1d_tfe_adjust_writemask_2:241; GFX10PLUS:       ; %bb.0: ; %main_body242; GFX10PLUS-NEXT:    s_mov_b32 s12, exec_lo243; GFX10PLUS-NEXT:    s_wqm_b32 exec_lo, exec_lo244; GFX10PLUS-NEXT:    v_mov_b32_e32 v2, v0245; GFX10PLUS-NEXT:    v_mov_b32_e32 v0, 0246; GFX10PLUS-NEXT:    v_mov_b32_e32 v1, v0247; GFX10PLUS-NEXT:    s_and_b32 exec_lo, exec_lo, s12248; GFX10PLUS-NEXT:    image_sample v[0:1], v2, s[0:7], s[8:11] dmask:0x2 dim:SQ_RSRC_IMG_1D tfe249; GFX10PLUS-NEXT:    s_waitcnt vmcnt(0)250; GFX10PLUS-NEXT:    ; return to shader part epilog251;252; GFX12-LABEL: sample_1d_tfe_adjust_writemask_2:253; GFX12:       ; %bb.0: ; %main_body254; GFX12-NEXT:    s_mov_b32 s12, exec_lo255; GFX12-NEXT:    s_wqm_b32 exec_lo, exec_lo256; GFX12-NEXT:    v_mov_b32_e32 v2, v0257; GFX12-NEXT:    v_mov_b32_e32 v0, 0258; GFX12-NEXT:    v_mov_b32_e32 v1, v0259; GFX12-NEXT:    s_and_b32 exec_lo, exec_lo, s12260; GFX12-NEXT:    image_sample v[0:1], v2, s[0:7], s[8:11] dmask:0x2 dim:SQ_RSRC_IMG_1D tfe261; GFX12-NEXT:    s_wait_samplecnt 0x0262; GFX12-NEXT:    ; return to shader part epilog263main_body:264  %v = call {<4 x float>,i32} @llvm.amdgcn.image.sample.1d.v4f32i32.f32(i32 15, float %s, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 1, i32 0)265  %res.vec = extractvalue {<4 x float>,i32} %v, 0266  %res.f = extractelement <4 x float> %res.vec, i32 1267  %res.err = extractvalue {<4 x float>,i32} %v, 1268  %res.errf = bitcast i32 %res.err to float269  %res.tmp = insertelement <2 x float> poison, float %res.f, i32 0270  %res = insertelement <2 x float> %res.tmp, float %res.errf, i32 1271  ret <2 x float> %res272}273 274define amdgpu_ps <2 x float> @sample_1d_tfe_adjust_writemask_3(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %s) {275; VERDE-LABEL: sample_1d_tfe_adjust_writemask_3:276; VERDE:       ; %bb.0: ; %main_body277; VERDE-NEXT:    s_mov_b64 s[12:13], exec278; VERDE-NEXT:    s_wqm_b64 exec, exec279; VERDE-NEXT:    v_mov_b32_e32 v2, v0280; VERDE-NEXT:    v_mov_b32_e32 v0, 0281; VERDE-NEXT:    v_mov_b32_e32 v1, v0282; VERDE-NEXT:    s_and_b64 exec, exec, s[12:13]283; VERDE-NEXT:    image_sample v[0:1], v2, s[0:7], s[8:11] dmask:0x4 tfe284; VERDE-NEXT:    s_waitcnt vmcnt(0)285; VERDE-NEXT:    ; return to shader part epilog286;287; GFX6789-LABEL: sample_1d_tfe_adjust_writemask_3:288; GFX6789:       ; %bb.0: ; %main_body289; GFX6789-NEXT:    s_mov_b64 s[12:13], exec290; GFX6789-NEXT:    s_wqm_b64 exec, exec291; GFX6789-NEXT:    v_mov_b32_e32 v2, v0292; GFX6789-NEXT:    v_mov_b32_e32 v0, 0293; GFX6789-NEXT:    v_mov_b32_e32 v1, v0294; GFX6789-NEXT:    s_and_b64 exec, exec, s[12:13]295; GFX6789-NEXT:    image_sample v[0:1], v2, s[0:7], s[8:11] dmask:0x4 tfe296; GFX6789-NEXT:    s_waitcnt vmcnt(0)297; GFX6789-NEXT:    ; return to shader part epilog298;299; GFX10PLUS-LABEL: sample_1d_tfe_adjust_writemask_3:300; GFX10PLUS:       ; %bb.0: ; %main_body301; GFX10PLUS-NEXT:    s_mov_b32 s12, exec_lo302; GFX10PLUS-NEXT:    s_wqm_b32 exec_lo, exec_lo303; GFX10PLUS-NEXT:    v_mov_b32_e32 v2, v0304; GFX10PLUS-NEXT:    v_mov_b32_e32 v0, 0305; GFX10PLUS-NEXT:    v_mov_b32_e32 v1, v0306; GFX10PLUS-NEXT:    s_and_b32 exec_lo, exec_lo, s12307; GFX10PLUS-NEXT:    image_sample v[0:1], v2, s[0:7], s[8:11] dmask:0x4 dim:SQ_RSRC_IMG_1D tfe308; GFX10PLUS-NEXT:    s_waitcnt vmcnt(0)309; GFX10PLUS-NEXT:    ; return to shader part epilog310;311; GFX12-LABEL: sample_1d_tfe_adjust_writemask_3:312; GFX12:       ; %bb.0: ; %main_body313; GFX12-NEXT:    s_mov_b32 s12, exec_lo314; GFX12-NEXT:    s_wqm_b32 exec_lo, exec_lo315; GFX12-NEXT:    v_mov_b32_e32 v2, v0316; GFX12-NEXT:    v_mov_b32_e32 v0, 0317; GFX12-NEXT:    v_mov_b32_e32 v1, v0318; GFX12-NEXT:    s_and_b32 exec_lo, exec_lo, s12319; GFX12-NEXT:    image_sample v[0:1], v2, s[0:7], s[8:11] dmask:0x4 dim:SQ_RSRC_IMG_1D tfe320; GFX12-NEXT:    s_wait_samplecnt 0x0321; GFX12-NEXT:    ; return to shader part epilog322main_body:323  %v = call {<4 x float>,i32} @llvm.amdgcn.image.sample.1d.v4f32i32.f32(i32 15, float %s, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 1, i32 0)324  %res.vec = extractvalue {<4 x float>,i32} %v, 0325  %res.f = extractelement <4 x float> %res.vec, i32 2326  %res.err = extractvalue {<4 x float>,i32} %v, 1327  %res.errf = bitcast i32 %res.err to float328  %res.tmp = insertelement <2 x float> poison, float %res.f, i32 0329  %res = insertelement <2 x float> %res.tmp, float %res.errf, i32 1330  ret <2 x float> %res331}332 333define amdgpu_ps <2 x float> @sample_1d_tfe_adjust_writemask_4(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %s) {334; VERDE-LABEL: sample_1d_tfe_adjust_writemask_4:335; VERDE:       ; %bb.0: ; %main_body336; VERDE-NEXT:    s_mov_b64 s[12:13], exec337; VERDE-NEXT:    s_wqm_b64 exec, exec338; VERDE-NEXT:    v_mov_b32_e32 v2, v0339; VERDE-NEXT:    v_mov_b32_e32 v0, 0340; VERDE-NEXT:    v_mov_b32_e32 v1, v0341; VERDE-NEXT:    s_and_b64 exec, exec, s[12:13]342; VERDE-NEXT:    image_sample v[0:1], v2, s[0:7], s[8:11] dmask:0x8 tfe343; VERDE-NEXT:    s_waitcnt vmcnt(0)344; VERDE-NEXT:    ; return to shader part epilog345;346; GFX6789-LABEL: sample_1d_tfe_adjust_writemask_4:347; GFX6789:       ; %bb.0: ; %main_body348; GFX6789-NEXT:    s_mov_b64 s[12:13], exec349; GFX6789-NEXT:    s_wqm_b64 exec, exec350; GFX6789-NEXT:    v_mov_b32_e32 v2, v0351; GFX6789-NEXT:    v_mov_b32_e32 v0, 0352; GFX6789-NEXT:    v_mov_b32_e32 v1, v0353; GFX6789-NEXT:    s_and_b64 exec, exec, s[12:13]354; GFX6789-NEXT:    image_sample v[0:1], v2, s[0:7], s[8:11] dmask:0x8 tfe355; GFX6789-NEXT:    s_waitcnt vmcnt(0)356; GFX6789-NEXT:    ; return to shader part epilog357;358; GFX10PLUS-LABEL: sample_1d_tfe_adjust_writemask_4:359; GFX10PLUS:       ; %bb.0: ; %main_body360; GFX10PLUS-NEXT:    s_mov_b32 s12, exec_lo361; GFX10PLUS-NEXT:    s_wqm_b32 exec_lo, exec_lo362; GFX10PLUS-NEXT:    v_mov_b32_e32 v2, v0363; GFX10PLUS-NEXT:    v_mov_b32_e32 v0, 0364; GFX10PLUS-NEXT:    v_mov_b32_e32 v1, v0365; GFX10PLUS-NEXT:    s_and_b32 exec_lo, exec_lo, s12366; GFX10PLUS-NEXT:    image_sample v[0:1], v2, s[0:7], s[8:11] dmask:0x8 dim:SQ_RSRC_IMG_1D tfe367; GFX10PLUS-NEXT:    s_waitcnt vmcnt(0)368; GFX10PLUS-NEXT:    ; return to shader part epilog369;370; GFX12-LABEL: sample_1d_tfe_adjust_writemask_4:371; GFX12:       ; %bb.0: ; %main_body372; GFX12-NEXT:    s_mov_b32 s12, exec_lo373; GFX12-NEXT:    s_wqm_b32 exec_lo, exec_lo374; GFX12-NEXT:    v_mov_b32_e32 v2, v0375; GFX12-NEXT:    v_mov_b32_e32 v0, 0376; GFX12-NEXT:    v_mov_b32_e32 v1, v0377; GFX12-NEXT:    s_and_b32 exec_lo, exec_lo, s12378; GFX12-NEXT:    image_sample v[0:1], v2, s[0:7], s[8:11] dmask:0x8 dim:SQ_RSRC_IMG_1D tfe379; GFX12-NEXT:    s_wait_samplecnt 0x0380; GFX12-NEXT:    ; return to shader part epilog381main_body:382  %v = call {<4 x float>,i32} @llvm.amdgcn.image.sample.1d.v4f32i32.f32(i32 15, float %s, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 1, i32 0)383  %res.vec = extractvalue {<4 x float>,i32} %v, 0384  %res.f = extractelement <4 x float> %res.vec, i32 3385  %res.err = extractvalue {<4 x float>,i32} %v, 1386  %res.errf = bitcast i32 %res.err to float387  %res.tmp = insertelement <2 x float> poison, float %res.f, i32 0388  %res = insertelement <2 x float> %res.tmp, float %res.errf, i32 1389  ret <2 x float> %res390}391 392define amdgpu_ps <4 x float> @sample_1d_tfe_adjust_writemask_12(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %s) {393; VERDE-LABEL: sample_1d_tfe_adjust_writemask_12:394; VERDE:       ; %bb.0: ; %main_body395; VERDE-NEXT:    s_mov_b64 s[12:13], exec396; VERDE-NEXT:    s_wqm_b64 exec, exec397; VERDE-NEXT:    v_mov_b32_e32 v3, v0398; VERDE-NEXT:    v_mov_b32_e32 v0, 0399; VERDE-NEXT:    v_mov_b32_e32 v1, v0400; VERDE-NEXT:    v_mov_b32_e32 v2, v0401; VERDE-NEXT:    s_and_b64 exec, exec, s[12:13]402; VERDE-NEXT:    image_sample v[0:2], v3, s[0:7], s[8:11] dmask:0x3 tfe403; VERDE-NEXT:    s_waitcnt vmcnt(0)404; VERDE-NEXT:    ; return to shader part epilog405;406; GFX6789-LABEL: sample_1d_tfe_adjust_writemask_12:407; GFX6789:       ; %bb.0: ; %main_body408; GFX6789-NEXT:    s_mov_b64 s[12:13], exec409; GFX6789-NEXT:    s_wqm_b64 exec, exec410; GFX6789-NEXT:    v_mov_b32_e32 v3, v0411; GFX6789-NEXT:    v_mov_b32_e32 v0, 0412; GFX6789-NEXT:    v_mov_b32_e32 v1, v0413; GFX6789-NEXT:    v_mov_b32_e32 v2, v0414; GFX6789-NEXT:    s_and_b64 exec, exec, s[12:13]415; GFX6789-NEXT:    image_sample v[0:2], v3, s[0:7], s[8:11] dmask:0x3 tfe416; GFX6789-NEXT:    s_waitcnt vmcnt(0)417; GFX6789-NEXT:    ; return to shader part epilog418;419; GFX10-LABEL: sample_1d_tfe_adjust_writemask_12:420; GFX10:       ; %bb.0: ; %main_body421; GFX10-NEXT:    s_mov_b32 s12, exec_lo422; GFX10-NEXT:    s_wqm_b32 exec_lo, exec_lo423; GFX10-NEXT:    v_mov_b32_e32 v3, v0424; GFX10-NEXT:    v_mov_b32_e32 v0, 0425; GFX10-NEXT:    v_mov_b32_e32 v1, v0426; GFX10-NEXT:    v_mov_b32_e32 v2, v0427; GFX10-NEXT:    s_and_b32 exec_lo, exec_lo, s12428; GFX10-NEXT:    image_sample v[0:2], v3, s[0:7], s[8:11] dmask:0x3 dim:SQ_RSRC_IMG_1D tfe429; GFX10-NEXT:    s_waitcnt vmcnt(0)430; GFX10-NEXT:    ; return to shader part epilog431;432; GFX11-LABEL: sample_1d_tfe_adjust_writemask_12:433; GFX11:       ; %bb.0: ; %main_body434; GFX11-NEXT:    s_mov_b32 s12, exec_lo435; GFX11-NEXT:    s_wqm_b32 exec_lo, exec_lo436; GFX11-NEXT:    v_dual_mov_b32 v3, v0 :: v_dual_mov_b32 v0, 0437; GFX11-NEXT:    v_mov_b32_e32 v1, v0438; GFX11-NEXT:    v_mov_b32_e32 v2, v0439; GFX11-NEXT:    s_and_b32 exec_lo, exec_lo, s12440; GFX11-NEXT:    image_sample v[0:2], v3, s[0:7], s[8:11] dmask:0x3 dim:SQ_RSRC_IMG_1D tfe441; GFX11-NEXT:    s_waitcnt vmcnt(0)442; GFX11-NEXT:    ; return to shader part epilog443;444; GFX12-LABEL: sample_1d_tfe_adjust_writemask_12:445; GFX12:       ; %bb.0: ; %main_body446; GFX12-NEXT:    s_mov_b32 s12, exec_lo447; GFX12-NEXT:    s_wqm_b32 exec_lo, exec_lo448; GFX12-NEXT:    v_dual_mov_b32 v3, v0 :: v_dual_mov_b32 v0, 0449; GFX12-NEXT:    v_dual_mov_b32 v1, v0 :: v_dual_mov_b32 v2, v0450; GFX12-NEXT:    s_and_b32 exec_lo, exec_lo, s12451; GFX12-NEXT:    image_sample v[0:2], v3, s[0:7], s[8:11] dmask:0x3 dim:SQ_RSRC_IMG_1D tfe452; GFX12-NEXT:    s_wait_samplecnt 0x0453; GFX12-NEXT:    ; return to shader part epilog454main_body:455  %v = call {<4 x float>,i32} @llvm.amdgcn.image.sample.1d.v4f32i32.f32(i32 15, float %s, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 1, i32 0)456  %res.vec = extractvalue {<4 x float>,i32} %v, 0457  %res.f1 = extractelement <4 x float> %res.vec, i32 0458  %res.f2 = extractelement <4 x float> %res.vec, i32 1459  %res.err = extractvalue {<4 x float>,i32} %v, 1460  %res.errf = bitcast i32 %res.err to float461  %res.tmp1 = insertelement <4 x float> poison, float %res.f1, i32 0462  %res.tmp2 = insertelement <4 x float> %res.tmp1, float %res.f2, i32 1463  %res = insertelement <4 x float> %res.tmp2, float %res.errf, i32 2464  ret <4 x float> %res465}466 467define amdgpu_ps <4 x float> @sample_1d_tfe_adjust_writemask_24(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %s) {468; VERDE-LABEL: sample_1d_tfe_adjust_writemask_24:469; VERDE:       ; %bb.0: ; %main_body470; VERDE-NEXT:    s_mov_b64 s[12:13], exec471; VERDE-NEXT:    s_wqm_b64 exec, exec472; VERDE-NEXT:    v_mov_b32_e32 v3, v0473; VERDE-NEXT:    v_mov_b32_e32 v0, 0474; VERDE-NEXT:    v_mov_b32_e32 v1, v0475; VERDE-NEXT:    v_mov_b32_e32 v2, v0476; VERDE-NEXT:    s_and_b64 exec, exec, s[12:13]477; VERDE-NEXT:    image_sample v[0:2], v3, s[0:7], s[8:11] dmask:0xa tfe478; VERDE-NEXT:    s_waitcnt vmcnt(0)479; VERDE-NEXT:    ; return to shader part epilog480;481; GFX6789-LABEL: sample_1d_tfe_adjust_writemask_24:482; GFX6789:       ; %bb.0: ; %main_body483; GFX6789-NEXT:    s_mov_b64 s[12:13], exec484; GFX6789-NEXT:    s_wqm_b64 exec, exec485; GFX6789-NEXT:    v_mov_b32_e32 v3, v0486; GFX6789-NEXT:    v_mov_b32_e32 v0, 0487; GFX6789-NEXT:    v_mov_b32_e32 v1, v0488; GFX6789-NEXT:    v_mov_b32_e32 v2, v0489; GFX6789-NEXT:    s_and_b64 exec, exec, s[12:13]490; GFX6789-NEXT:    image_sample v[0:2], v3, s[0:7], s[8:11] dmask:0xa tfe491; GFX6789-NEXT:    s_waitcnt vmcnt(0)492; GFX6789-NEXT:    ; return to shader part epilog493;494; GFX10-LABEL: sample_1d_tfe_adjust_writemask_24:495; GFX10:       ; %bb.0: ; %main_body496; GFX10-NEXT:    s_mov_b32 s12, exec_lo497; GFX10-NEXT:    s_wqm_b32 exec_lo, exec_lo498; GFX10-NEXT:    v_mov_b32_e32 v3, v0499; GFX10-NEXT:    v_mov_b32_e32 v0, 0500; GFX10-NEXT:    v_mov_b32_e32 v1, v0501; GFX10-NEXT:    v_mov_b32_e32 v2, v0502; GFX10-NEXT:    s_and_b32 exec_lo, exec_lo, s12503; GFX10-NEXT:    image_sample v[0:2], v3, s[0:7], s[8:11] dmask:0xa dim:SQ_RSRC_IMG_1D tfe504; GFX10-NEXT:    s_waitcnt vmcnt(0)505; GFX10-NEXT:    ; return to shader part epilog506;507; GFX11-LABEL: sample_1d_tfe_adjust_writemask_24:508; GFX11:       ; %bb.0: ; %main_body509; GFX11-NEXT:    s_mov_b32 s12, exec_lo510; GFX11-NEXT:    s_wqm_b32 exec_lo, exec_lo511; GFX11-NEXT:    v_dual_mov_b32 v3, v0 :: v_dual_mov_b32 v0, 0512; GFX11-NEXT:    v_mov_b32_e32 v1, v0513; GFX11-NEXT:    v_mov_b32_e32 v2, v0514; GFX11-NEXT:    s_and_b32 exec_lo, exec_lo, s12515; GFX11-NEXT:    image_sample v[0:2], v3, s[0:7], s[8:11] dmask:0xa dim:SQ_RSRC_IMG_1D tfe516; GFX11-NEXT:    s_waitcnt vmcnt(0)517; GFX11-NEXT:    ; return to shader part epilog518;519; GFX12-LABEL: sample_1d_tfe_adjust_writemask_24:520; GFX12:       ; %bb.0: ; %main_body521; GFX12-NEXT:    s_mov_b32 s12, exec_lo522; GFX12-NEXT:    s_wqm_b32 exec_lo, exec_lo523; GFX12-NEXT:    v_dual_mov_b32 v3, v0 :: v_dual_mov_b32 v0, 0524; GFX12-NEXT:    v_dual_mov_b32 v1, v0 :: v_dual_mov_b32 v2, v0525; GFX12-NEXT:    s_and_b32 exec_lo, exec_lo, s12526; GFX12-NEXT:    image_sample v[0:2], v3, s[0:7], s[8:11] dmask:0xa dim:SQ_RSRC_IMG_1D tfe527; GFX12-NEXT:    s_wait_samplecnt 0x0528; GFX12-NEXT:    ; return to shader part epilog529main_body:530  %v = call {<4 x float>,i32} @llvm.amdgcn.image.sample.1d.v4f32i32.f32(i32 15, float %s, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 1, i32 0)531  %res.vec = extractvalue {<4 x float>,i32} %v, 0532  %res.f1 = extractelement <4 x float> %res.vec, i32 1533  %res.f2 = extractelement <4 x float> %res.vec, i32 3534  %res.err = extractvalue {<4 x float>,i32} %v, 1535  %res.errf = bitcast i32 %res.err to float536  %res.tmp1 = insertelement <4 x float> poison, float %res.f1, i32 0537  %res.tmp2 = insertelement <4 x float> %res.tmp1, float %res.f2, i32 1538  %res = insertelement <4 x float> %res.tmp2, float %res.errf, i32 2539  ret <4 x float> %res540}541 542define amdgpu_ps <4 x float> @sample_1d_tfe_adjust_writemask_134(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %s) {543; VERDE-LABEL: sample_1d_tfe_adjust_writemask_134:544; VERDE:       ; %bb.0: ; %main_body545; VERDE-NEXT:    s_mov_b64 s[12:13], exec546; VERDE-NEXT:    s_wqm_b64 exec, exec547; VERDE-NEXT:    v_mov_b32_e32 v4, v0548; VERDE-NEXT:    v_mov_b32_e32 v0, 0549; VERDE-NEXT:    v_mov_b32_e32 v1, v0550; VERDE-NEXT:    v_mov_b32_e32 v2, v0551; VERDE-NEXT:    v_mov_b32_e32 v3, v0552; VERDE-NEXT:    s_and_b64 exec, exec, s[12:13]553; VERDE-NEXT:    image_sample v[0:3], v4, s[0:7], s[8:11] dmask:0xd tfe554; VERDE-NEXT:    s_waitcnt vmcnt(0)555; VERDE-NEXT:    ; return to shader part epilog556;557; GFX6789-LABEL: sample_1d_tfe_adjust_writemask_134:558; GFX6789:       ; %bb.0: ; %main_body559; GFX6789-NEXT:    s_mov_b64 s[12:13], exec560; GFX6789-NEXT:    s_wqm_b64 exec, exec561; GFX6789-NEXT:    v_mov_b32_e32 v4, v0562; GFX6789-NEXT:    v_mov_b32_e32 v0, 0563; GFX6789-NEXT:    v_mov_b32_e32 v1, v0564; GFX6789-NEXT:    v_mov_b32_e32 v2, v0565; GFX6789-NEXT:    v_mov_b32_e32 v3, v0566; GFX6789-NEXT:    s_and_b64 exec, exec, s[12:13]567; GFX6789-NEXT:    image_sample v[0:3], v4, s[0:7], s[8:11] dmask:0xd tfe568; GFX6789-NEXT:    s_waitcnt vmcnt(0)569; GFX6789-NEXT:    ; return to shader part epilog570;571; GFX10PLUS-LABEL: sample_1d_tfe_adjust_writemask_134:572; GFX10PLUS:       ; %bb.0: ; %main_body573; GFX10PLUS-NEXT:    s_mov_b32 s12, exec_lo574; GFX10PLUS-NEXT:    s_wqm_b32 exec_lo, exec_lo575; GFX10PLUS-NEXT:    v_mov_b32_e32 v4, v0576; GFX10PLUS-NEXT:    v_mov_b32_e32 v0, 0577; GFX10PLUS-NEXT:    v_mov_b32_e32 v1, v0578; GFX10PLUS-NEXT:    v_mov_b32_e32 v2, v0579; GFX10PLUS-NEXT:    v_mov_b32_e32 v3, v0580; GFX10PLUS-NEXT:    s_and_b32 exec_lo, exec_lo, s12581; GFX10PLUS-NEXT:    image_sample v[0:3], v4, s[0:7], s[8:11] dmask:0xd dim:SQ_RSRC_IMG_1D tfe582; GFX10PLUS-NEXT:    s_waitcnt vmcnt(0)583; GFX10PLUS-NEXT:    ; return to shader part epilog584;585; GFX12-LABEL: sample_1d_tfe_adjust_writemask_134:586; GFX12:       ; %bb.0: ; %main_body587; GFX12-NEXT:    s_mov_b32 s12, exec_lo588; GFX12-NEXT:    s_wqm_b32 exec_lo, exec_lo589; GFX12-NEXT:    v_mov_b32_e32 v4, v0590; GFX12-NEXT:    v_mov_b32_e32 v0, 0591; GFX12-NEXT:    v_dual_mov_b32 v1, v0 :: v_dual_mov_b32 v2, v0592; GFX12-NEXT:    v_mov_b32_e32 v3, v0593; GFX12-NEXT:    s_and_b32 exec_lo, exec_lo, s12594; GFX12-NEXT:    image_sample v[0:3], v4, s[0:7], s[8:11] dmask:0xd dim:SQ_RSRC_IMG_1D tfe595; GFX12-NEXT:    s_wait_samplecnt 0x0596; GFX12-NEXT:    ; return to shader part epilog597main_body:598  %v = call {<4 x float>,i32} @llvm.amdgcn.image.sample.1d.v4f32i32.f32(i32 15, float %s, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 1, i32 0)599  %res.vec = extractvalue {<4 x float>,i32} %v, 0600  %res.f1 = extractelement <4 x float> %res.vec, i32 0601  %res.f2 = extractelement <4 x float> %res.vec, i32 2602  %res.f3 = extractelement <4 x float> %res.vec, i32 3603  %res.err = extractvalue {<4 x float>,i32} %v, 1604  %res.errf = bitcast i32 %res.err to float605  %res.tmp1 = insertelement <4 x float> poison, float %res.f1, i32 0606  %res.tmp2 = insertelement <4 x float> %res.tmp1, float %res.f2, i32 1607  %res.tmp3 = insertelement <4 x float> %res.tmp2, float %res.f3, i32 2608  %res = insertelement <4 x float> %res.tmp3, float %res.errf, i32 3609  ret <4 x float> %res610}611 612define amdgpu_ps <4 x float> @sample_1d_lwe(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, ptr addrspace(1) inreg %out, float %s) {613; VERDE-LABEL: sample_1d_lwe:614; VERDE:       ; %bb.0: ; %main_body615; VERDE-NEXT:    s_mov_b64 s[14:15], exec616; VERDE-NEXT:    s_wqm_b64 exec, exec617; VERDE-NEXT:    v_mov_b32_e32 v5, v0618; VERDE-NEXT:    v_mov_b32_e32 v0, 0619; VERDE-NEXT:    v_mov_b32_e32 v1, v0620; VERDE-NEXT:    v_mov_b32_e32 v2, v0621; VERDE-NEXT:    v_mov_b32_e32 v3, v0622; VERDE-NEXT:    v_mov_b32_e32 v4, v0623; VERDE-NEXT:    s_and_b64 exec, exec, s[14:15]624; VERDE-NEXT:    image_sample v[0:4], v5, s[0:7], s[8:11] dmask:0xf lwe625; VERDE-NEXT:    s_mov_b32 s15, 0xf000626; VERDE-NEXT:    s_mov_b32 s14, -1627; VERDE-NEXT:    s_waitcnt vmcnt(0)628; VERDE-NEXT:    buffer_store_dword v4, off, s[12:15], 0629; VERDE-NEXT:    s_waitcnt vmcnt(0) expcnt(0)630; VERDE-NEXT:    ; return to shader part epilog631;632; GFX6789-LABEL: sample_1d_lwe:633; GFX6789:       ; %bb.0: ; %main_body634; GFX6789-NEXT:    s_mov_b64 s[14:15], exec635; GFX6789-NEXT:    s_wqm_b64 exec, exec636; GFX6789-NEXT:    v_mov_b32_e32 v6, 0637; GFX6789-NEXT:    v_mov_b32_e32 v5, v0638; GFX6789-NEXT:    v_mov_b32_e32 v7, v6639; GFX6789-NEXT:    v_mov_b32_e32 v8, v6640; GFX6789-NEXT:    v_mov_b32_e32 v9, v6641; GFX6789-NEXT:    v_mov_b32_e32 v10, v6642; GFX6789-NEXT:    v_mov_b32_e32 v0, v6643; GFX6789-NEXT:    v_mov_b32_e32 v1, v7644; GFX6789-NEXT:    v_mov_b32_e32 v2, v8645; GFX6789-NEXT:    v_mov_b32_e32 v3, v9646; GFX6789-NEXT:    v_mov_b32_e32 v4, v10647; GFX6789-NEXT:    s_and_b64 exec, exec, s[14:15]648; GFX6789-NEXT:    image_sample v[0:4], v5, s[0:7], s[8:11] dmask:0xf lwe649; GFX6789-NEXT:    s_waitcnt vmcnt(0)650; GFX6789-NEXT:    global_store_dword v6, v4, s[12:13]651; GFX6789-NEXT:    s_waitcnt vmcnt(0)652; GFX6789-NEXT:    ; return to shader part epilog653;654; GFX10-LABEL: sample_1d_lwe:655; GFX10:       ; %bb.0: ; %main_body656; GFX10-NEXT:    s_mov_b32 s14, exec_lo657; GFX10-NEXT:    s_wqm_b32 exec_lo, exec_lo658; GFX10-NEXT:    v_mov_b32_e32 v6, 0659; GFX10-NEXT:    v_mov_b32_e32 v5, v0660; GFX10-NEXT:    v_mov_b32_e32 v7, v6661; GFX10-NEXT:    v_mov_b32_e32 v8, v6662; GFX10-NEXT:    v_mov_b32_e32 v9, v6663; GFX10-NEXT:    v_mov_b32_e32 v10, v6664; GFX10-NEXT:    v_mov_b32_e32 v0, v6665; GFX10-NEXT:    v_mov_b32_e32 v1, v7666; GFX10-NEXT:    v_mov_b32_e32 v2, v8667; GFX10-NEXT:    v_mov_b32_e32 v3, v9668; GFX10-NEXT:    v_mov_b32_e32 v4, v10669; GFX10-NEXT:    s_and_b32 exec_lo, exec_lo, s14670; GFX10-NEXT:    image_sample v[0:4], v5, s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_1D lwe671; GFX10-NEXT:    s_waitcnt vmcnt(0)672; GFX10-NEXT:    global_store_dword v6, v4, s[12:13]673; GFX10-NEXT:    ; return to shader part epilog674;675; GFX11-LABEL: sample_1d_lwe:676; GFX11:       ; %bb.0: ; %main_body677; GFX11-NEXT:    s_mov_b32 s14, exec_lo678; GFX11-NEXT:    s_wqm_b32 exec_lo, exec_lo679; GFX11-NEXT:    v_dual_mov_b32 v5, v0 :: v_dual_mov_b32 v6, 0680; GFX11-NEXT:    v_mov_b32_e32 v7, v6681; GFX11-NEXT:    v_mov_b32_e32 v8, v6682; GFX11-NEXT:    v_mov_b32_e32 v9, v6683; GFX11-NEXT:    v_mov_b32_e32 v10, v6684; GFX11-NEXT:    v_dual_mov_b32 v0, v6 :: v_dual_mov_b32 v1, v7685; GFX11-NEXT:    v_dual_mov_b32 v2, v8 :: v_dual_mov_b32 v3, v9686; GFX11-NEXT:    v_mov_b32_e32 v4, v10687; GFX11-NEXT:    s_and_b32 exec_lo, exec_lo, s14688; GFX11-NEXT:    image_sample v[0:4], v5, s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_1D lwe689; GFX11-NEXT:    s_waitcnt vmcnt(0)690; GFX11-NEXT:    global_store_b32 v6, v4, s[12:13]691; GFX11-NEXT:    ; return to shader part epilog692;693; GFX12-LABEL: sample_1d_lwe:694; GFX12:       ; %bb.0: ; %main_body695; GFX12-NEXT:    s_mov_b32 s14, exec_lo696; GFX12-NEXT:    s_wqm_b32 exec_lo, exec_lo697; GFX12-NEXT:    v_dual_mov_b32 v5, v0 :: v_dual_mov_b32 v6, 0698; GFX12-NEXT:    v_dual_mov_b32 v7, v6 :: v_dual_mov_b32 v8, v6699; GFX12-NEXT:    v_dual_mov_b32 v9, v6 :: v_dual_mov_b32 v10, v6700; GFX12-NEXT:    v_dual_mov_b32 v0, v6 :: v_dual_mov_b32 v1, v7701; GFX12-NEXT:    v_dual_mov_b32 v2, v8 :: v_dual_mov_b32 v3, v9702; GFX12-NEXT:    v_mov_b32_e32 v4, v10703; GFX12-NEXT:    s_and_b32 exec_lo, exec_lo, s14704; GFX12-NEXT:    image_sample v[0:4], v5, s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_1D lwe705; GFX12-NEXT:    s_wait_samplecnt 0x0706; GFX12-NEXT:    global_store_b32 v6, v4, s[12:13]707; GFX12-NEXT:    ; return to shader part epilog708main_body:709  %v = call {<4 x float>,i32} @llvm.amdgcn.image.sample.1d.v4f32i32.f32(i32 15, float %s, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 2, i32 0)710  %v.vec = extractvalue {<4 x float>, i32} %v, 0711  %v.err = extractvalue {<4 x float>, i32} %v, 1712  store i32 %v.err, ptr addrspace(1) %out, align 4713  ret <4 x float> %v.vec714}715 716define amdgpu_ps <4 x float> @sample_2d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %s, float %t) {717; VERDE-LABEL: sample_2d:718; VERDE:       ; %bb.0: ; %main_body719; VERDE-NEXT:    s_mov_b64 s[12:13], exec720; VERDE-NEXT:    s_wqm_b64 exec, exec721; VERDE-NEXT:    s_and_b64 exec, exec, s[12:13]722; VERDE-NEXT:    image_sample v[0:3], v[0:1], s[0:7], s[8:11] dmask:0xf723; VERDE-NEXT:    s_waitcnt vmcnt(0)724; VERDE-NEXT:    ; return to shader part epilog725;726; GFX6789-LABEL: sample_2d:727; GFX6789:       ; %bb.0: ; %main_body728; GFX6789-NEXT:    s_mov_b64 s[12:13], exec729; GFX6789-NEXT:    s_wqm_b64 exec, exec730; GFX6789-NEXT:    s_and_b64 exec, exec, s[12:13]731; GFX6789-NEXT:    image_sample v[0:3], v[0:1], s[0:7], s[8:11] dmask:0xf732; GFX6789-NEXT:    s_waitcnt vmcnt(0)733; GFX6789-NEXT:    ; return to shader part epilog734;735; GFX10PLUS-LABEL: sample_2d:736; GFX10PLUS:       ; %bb.0: ; %main_body737; GFX10PLUS-NEXT:    s_mov_b32 s12, exec_lo738; GFX10PLUS-NEXT:    s_wqm_b32 exec_lo, exec_lo739; GFX10PLUS-NEXT:    s_and_b32 exec_lo, exec_lo, s12740; GFX10PLUS-NEXT:    image_sample v[0:3], v[0:1], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_2D741; GFX10PLUS-NEXT:    s_waitcnt vmcnt(0)742; GFX10PLUS-NEXT:    ; return to shader part epilog743;744; GFX12-LABEL: sample_2d:745; GFX12:       ; %bb.0: ; %main_body746; GFX12-NEXT:    s_mov_b32 s12, exec_lo747; GFX12-NEXT:    s_wqm_b32 exec_lo, exec_lo748; GFX12-NEXT:    s_and_b32 exec_lo, exec_lo, s12749; GFX12-NEXT:    image_sample v[0:3], [v0, v1], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_2D750; GFX12-NEXT:    s_wait_samplecnt 0x0751; GFX12-NEXT:    ; return to shader part epilog752main_body:753  %v = call <4 x float> @llvm.amdgcn.image.sample.2d.v4f32.f32(i32 15, float %s, float %t, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)754  ret <4 x float> %v755}756 757define amdgpu_ps <4 x float> @sample_3d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %s, float %t, float %r) {758; VERDE-LABEL: sample_3d:759; VERDE:       ; %bb.0: ; %main_body760; VERDE-NEXT:    s_mov_b64 s[12:13], exec761; VERDE-NEXT:    s_wqm_b64 exec, exec762; VERDE-NEXT:    s_and_b64 exec, exec, s[12:13]763; VERDE-NEXT:    image_sample v[0:3], v[0:2], s[0:7], s[8:11] dmask:0xf764; VERDE-NEXT:    s_waitcnt vmcnt(0)765; VERDE-NEXT:    ; return to shader part epilog766;767; GFX6789-LABEL: sample_3d:768; GFX6789:       ; %bb.0: ; %main_body769; GFX6789-NEXT:    s_mov_b64 s[12:13], exec770; GFX6789-NEXT:    s_wqm_b64 exec, exec771; GFX6789-NEXT:    s_and_b64 exec, exec, s[12:13]772; GFX6789-NEXT:    image_sample v[0:3], v[0:2], s[0:7], s[8:11] dmask:0xf773; GFX6789-NEXT:    s_waitcnt vmcnt(0)774; GFX6789-NEXT:    ; return to shader part epilog775;776; GFX10PLUS-LABEL: sample_3d:777; GFX10PLUS:       ; %bb.0: ; %main_body778; GFX10PLUS-NEXT:    s_mov_b32 s12, exec_lo779; GFX10PLUS-NEXT:    s_wqm_b32 exec_lo, exec_lo780; GFX10PLUS-NEXT:    s_and_b32 exec_lo, exec_lo, s12781; GFX10PLUS-NEXT:    image_sample v[0:3], v[0:2], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_3D782; GFX10PLUS-NEXT:    s_waitcnt vmcnt(0)783; GFX10PLUS-NEXT:    ; return to shader part epilog784;785; GFX12-LABEL: sample_3d:786; GFX12:       ; %bb.0: ; %main_body787; GFX12-NEXT:    s_mov_b32 s12, exec_lo788; GFX12-NEXT:    s_wqm_b32 exec_lo, exec_lo789; GFX12-NEXT:    s_and_b32 exec_lo, exec_lo, s12790; GFX12-NEXT:    image_sample v[0:3], [v0, v1, v2], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_3D791; GFX12-NEXT:    s_wait_samplecnt 0x0792; GFX12-NEXT:    ; return to shader part epilog793main_body:794  %v = call <4 x float> @llvm.amdgcn.image.sample.3d.v4f32.f32(i32 15, float %s, float %t, float %r, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)795  ret <4 x float> %v796}797 798define amdgpu_ps <4 x float> @sample_cube(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %s, float %t, float %face) {799; VERDE-LABEL: sample_cube:800; VERDE:       ; %bb.0: ; %main_body801; VERDE-NEXT:    s_mov_b64 s[12:13], exec802; VERDE-NEXT:    s_wqm_b64 exec, exec803; VERDE-NEXT:    s_and_b64 exec, exec, s[12:13]804; VERDE-NEXT:    image_sample v[0:3], v[0:2], s[0:7], s[8:11] dmask:0xf da805; VERDE-NEXT:    s_waitcnt vmcnt(0)806; VERDE-NEXT:    ; return to shader part epilog807;808; GFX6789-LABEL: sample_cube:809; GFX6789:       ; %bb.0: ; %main_body810; GFX6789-NEXT:    s_mov_b64 s[12:13], exec811; GFX6789-NEXT:    s_wqm_b64 exec, exec812; GFX6789-NEXT:    s_and_b64 exec, exec, s[12:13]813; GFX6789-NEXT:    image_sample v[0:3], v[0:2], s[0:7], s[8:11] dmask:0xf da814; GFX6789-NEXT:    s_waitcnt vmcnt(0)815; GFX6789-NEXT:    ; return to shader part epilog816;817; GFX10PLUS-LABEL: sample_cube:818; GFX10PLUS:       ; %bb.0: ; %main_body819; GFX10PLUS-NEXT:    s_mov_b32 s12, exec_lo820; GFX10PLUS-NEXT:    s_wqm_b32 exec_lo, exec_lo821; GFX10PLUS-NEXT:    s_and_b32 exec_lo, exec_lo, s12822; GFX10PLUS-NEXT:    image_sample v[0:3], v[0:2], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_CUBE823; GFX10PLUS-NEXT:    s_waitcnt vmcnt(0)824; GFX10PLUS-NEXT:    ; return to shader part epilog825;826; GFX12-LABEL: sample_cube:827; GFX12:       ; %bb.0: ; %main_body828; GFX12-NEXT:    s_mov_b32 s12, exec_lo829; GFX12-NEXT:    s_wqm_b32 exec_lo, exec_lo830; GFX12-NEXT:    s_and_b32 exec_lo, exec_lo, s12831; GFX12-NEXT:    image_sample v[0:3], [v0, v1, v2], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_CUBE832; GFX12-NEXT:    s_wait_samplecnt 0x0833; GFX12-NEXT:    ; return to shader part epilog834main_body:835  %v = call <4 x float> @llvm.amdgcn.image.sample.cube.v4f32.f32(i32 15, float %s, float %t, float %face, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)836  ret <4 x float> %v837}838 839define amdgpu_ps <4 x float> @sample_1darray(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %s, float %slice) {840; VERDE-LABEL: sample_1darray:841; VERDE:       ; %bb.0: ; %main_body842; VERDE-NEXT:    s_mov_b64 s[12:13], exec843; VERDE-NEXT:    s_wqm_b64 exec, exec844; VERDE-NEXT:    s_and_b64 exec, exec, s[12:13]845; VERDE-NEXT:    image_sample v[0:3], v[0:1], s[0:7], s[8:11] dmask:0xf da846; VERDE-NEXT:    s_waitcnt vmcnt(0)847; VERDE-NEXT:    ; return to shader part epilog848;849; GFX6789-LABEL: sample_1darray:850; GFX6789:       ; %bb.0: ; %main_body851; GFX6789-NEXT:    s_mov_b64 s[12:13], exec852; GFX6789-NEXT:    s_wqm_b64 exec, exec853; GFX6789-NEXT:    s_and_b64 exec, exec, s[12:13]854; GFX6789-NEXT:    image_sample v[0:3], v[0:1], s[0:7], s[8:11] dmask:0xf da855; GFX6789-NEXT:    s_waitcnt vmcnt(0)856; GFX6789-NEXT:    ; return to shader part epilog857;858; GFX10PLUS-LABEL: sample_1darray:859; GFX10PLUS:       ; %bb.0: ; %main_body860; GFX10PLUS-NEXT:    s_mov_b32 s12, exec_lo861; GFX10PLUS-NEXT:    s_wqm_b32 exec_lo, exec_lo862; GFX10PLUS-NEXT:    s_and_b32 exec_lo, exec_lo, s12863; GFX10PLUS-NEXT:    image_sample v[0:3], v[0:1], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_1D_ARRAY864; GFX10PLUS-NEXT:    s_waitcnt vmcnt(0)865; GFX10PLUS-NEXT:    ; return to shader part epilog866;867; GFX12-LABEL: sample_1darray:868; GFX12:       ; %bb.0: ; %main_body869; GFX12-NEXT:    s_mov_b32 s12, exec_lo870; GFX12-NEXT:    s_wqm_b32 exec_lo, exec_lo871; GFX12-NEXT:    s_and_b32 exec_lo, exec_lo, s12872; GFX12-NEXT:    image_sample v[0:3], [v0, v1], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_1D_ARRAY873; GFX12-NEXT:    s_wait_samplecnt 0x0874; GFX12-NEXT:    ; return to shader part epilog875main_body:876  %v = call <4 x float> @llvm.amdgcn.image.sample.1darray.v4f32.f32(i32 15, float %s, float %slice, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)877  ret <4 x float> %v878}879 880define amdgpu_ps <4 x float> @sample_2darray(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %s, float %t, float %slice) {881; VERDE-LABEL: sample_2darray:882; VERDE:       ; %bb.0: ; %main_body883; VERDE-NEXT:    s_mov_b64 s[12:13], exec884; VERDE-NEXT:    s_wqm_b64 exec, exec885; VERDE-NEXT:    s_and_b64 exec, exec, s[12:13]886; VERDE-NEXT:    image_sample v[0:3], v[0:2], s[0:7], s[8:11] dmask:0xf da887; VERDE-NEXT:    s_waitcnt vmcnt(0)888; VERDE-NEXT:    ; return to shader part epilog889;890; GFX6789-LABEL: sample_2darray:891; GFX6789:       ; %bb.0: ; %main_body892; GFX6789-NEXT:    s_mov_b64 s[12:13], exec893; GFX6789-NEXT:    s_wqm_b64 exec, exec894; GFX6789-NEXT:    s_and_b64 exec, exec, s[12:13]895; GFX6789-NEXT:    image_sample v[0:3], v[0:2], s[0:7], s[8:11] dmask:0xf da896; GFX6789-NEXT:    s_waitcnt vmcnt(0)897; GFX6789-NEXT:    ; return to shader part epilog898;899; GFX10PLUS-LABEL: sample_2darray:900; GFX10PLUS:       ; %bb.0: ; %main_body901; GFX10PLUS-NEXT:    s_mov_b32 s12, exec_lo902; GFX10PLUS-NEXT:    s_wqm_b32 exec_lo, exec_lo903; GFX10PLUS-NEXT:    s_and_b32 exec_lo, exec_lo, s12904; GFX10PLUS-NEXT:    image_sample v[0:3], v[0:2], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_2D_ARRAY905; GFX10PLUS-NEXT:    s_waitcnt vmcnt(0)906; GFX10PLUS-NEXT:    ; return to shader part epilog907;908; GFX12-LABEL: sample_2darray:909; GFX12:       ; %bb.0: ; %main_body910; GFX12-NEXT:    s_mov_b32 s12, exec_lo911; GFX12-NEXT:    s_wqm_b32 exec_lo, exec_lo912; GFX12-NEXT:    s_and_b32 exec_lo, exec_lo, s12913; GFX12-NEXT:    image_sample v[0:3], [v0, v1, v2], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_2D_ARRAY914; GFX12-NEXT:    s_wait_samplecnt 0x0915; GFX12-NEXT:    ; return to shader part epilog916main_body:917  %v = call <4 x float> @llvm.amdgcn.image.sample.2darray.v4f32.f32(i32 15, float %s, float %t, float %slice, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)918  ret <4 x float> %v919}920 921define amdgpu_ps <4 x float> @sample_c_1d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %zcompare, float %s) {922; VERDE-LABEL: sample_c_1d:923; VERDE:       ; %bb.0: ; %main_body924; VERDE-NEXT:    s_mov_b64 s[12:13], exec925; VERDE-NEXT:    s_wqm_b64 exec, exec926; VERDE-NEXT:    s_and_b64 exec, exec, s[12:13]927; VERDE-NEXT:    image_sample_c v[0:3], v[0:1], s[0:7], s[8:11] dmask:0xf928; VERDE-NEXT:    s_waitcnt vmcnt(0)929; VERDE-NEXT:    ; return to shader part epilog930;931; GFX6789-LABEL: sample_c_1d:932; GFX6789:       ; %bb.0: ; %main_body933; GFX6789-NEXT:    s_mov_b64 s[12:13], exec934; GFX6789-NEXT:    s_wqm_b64 exec, exec935; GFX6789-NEXT:    s_and_b64 exec, exec, s[12:13]936; GFX6789-NEXT:    image_sample_c v[0:3], v[0:1], s[0:7], s[8:11] dmask:0xf937; GFX6789-NEXT:    s_waitcnt vmcnt(0)938; GFX6789-NEXT:    ; return to shader part epilog939;940; GFX10PLUS-LABEL: sample_c_1d:941; GFX10PLUS:       ; %bb.0: ; %main_body942; GFX10PLUS-NEXT:    s_mov_b32 s12, exec_lo943; GFX10PLUS-NEXT:    s_wqm_b32 exec_lo, exec_lo944; GFX10PLUS-NEXT:    s_and_b32 exec_lo, exec_lo, s12945; GFX10PLUS-NEXT:    image_sample_c v[0:3], v[0:1], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_1D946; GFX10PLUS-NEXT:    s_waitcnt vmcnt(0)947; GFX10PLUS-NEXT:    ; return to shader part epilog948;949; GFX12-LABEL: sample_c_1d:950; GFX12:       ; %bb.0: ; %main_body951; GFX12-NEXT:    s_mov_b32 s12, exec_lo952; GFX12-NEXT:    s_wqm_b32 exec_lo, exec_lo953; GFX12-NEXT:    s_and_b32 exec_lo, exec_lo, s12954; GFX12-NEXT:    image_sample_c v[0:3], [v0, v1], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_1D955; GFX12-NEXT:    s_wait_samplecnt 0x0956; GFX12-NEXT:    ; return to shader part epilog957main_body:958  %v = call <4 x float> @llvm.amdgcn.image.sample.c.1d.v4f32.f32(i32 15, float %zcompare, float %s, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)959  ret <4 x float> %v960}961 962define amdgpu_ps <4 x float> @sample_c_2d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %zcompare, float %s, float %t) {963; VERDE-LABEL: sample_c_2d:964; VERDE:       ; %bb.0: ; %main_body965; VERDE-NEXT:    s_mov_b64 s[12:13], exec966; VERDE-NEXT:    s_wqm_b64 exec, exec967; VERDE-NEXT:    s_and_b64 exec, exec, s[12:13]968; VERDE-NEXT:    image_sample_c v[0:3], v[0:2], s[0:7], s[8:11] dmask:0xf969; VERDE-NEXT:    s_waitcnt vmcnt(0)970; VERDE-NEXT:    ; return to shader part epilog971;972; GFX6789-LABEL: sample_c_2d:973; GFX6789:       ; %bb.0: ; %main_body974; GFX6789-NEXT:    s_mov_b64 s[12:13], exec975; GFX6789-NEXT:    s_wqm_b64 exec, exec976; GFX6789-NEXT:    s_and_b64 exec, exec, s[12:13]977; GFX6789-NEXT:    image_sample_c v[0:3], v[0:2], s[0:7], s[8:11] dmask:0xf978; GFX6789-NEXT:    s_waitcnt vmcnt(0)979; GFX6789-NEXT:    ; return to shader part epilog980;981; GFX10PLUS-LABEL: sample_c_2d:982; GFX10PLUS:       ; %bb.0: ; %main_body983; GFX10PLUS-NEXT:    s_mov_b32 s12, exec_lo984; GFX10PLUS-NEXT:    s_wqm_b32 exec_lo, exec_lo985; GFX10PLUS-NEXT:    s_and_b32 exec_lo, exec_lo, s12986; GFX10PLUS-NEXT:    image_sample_c v[0:3], v[0:2], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_2D987; GFX10PLUS-NEXT:    s_waitcnt vmcnt(0)988; GFX10PLUS-NEXT:    ; return to shader part epilog989;990; GFX12-LABEL: sample_c_2d:991; GFX12:       ; %bb.0: ; %main_body992; GFX12-NEXT:    s_mov_b32 s12, exec_lo993; GFX12-NEXT:    s_wqm_b32 exec_lo, exec_lo994; GFX12-NEXT:    s_and_b32 exec_lo, exec_lo, s12995; GFX12-NEXT:    image_sample_c v[0:3], [v0, v1, v2], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_2D996; GFX12-NEXT:    s_wait_samplecnt 0x0997; GFX12-NEXT:    ; return to shader part epilog998main_body:999  %v = call <4 x float> @llvm.amdgcn.image.sample.c.2d.v4f32.f32(i32 15, float %zcompare, float %s, float %t, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)1000  ret <4 x float> %v1001}1002 1003define amdgpu_ps <4 x float> @sample_cl_1d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %s, float %clamp) {1004; VERDE-LABEL: sample_cl_1d:1005; VERDE:       ; %bb.0: ; %main_body1006; VERDE-NEXT:    s_mov_b64 s[12:13], exec1007; VERDE-NEXT:    s_wqm_b64 exec, exec1008; VERDE-NEXT:    s_and_b64 exec, exec, s[12:13]1009; VERDE-NEXT:    image_sample_cl v[0:3], v[0:1], s[0:7], s[8:11] dmask:0xf1010; VERDE-NEXT:    s_waitcnt vmcnt(0)1011; VERDE-NEXT:    ; return to shader part epilog1012;1013; GFX6789-LABEL: sample_cl_1d:1014; GFX6789:       ; %bb.0: ; %main_body1015; GFX6789-NEXT:    s_mov_b64 s[12:13], exec1016; GFX6789-NEXT:    s_wqm_b64 exec, exec1017; GFX6789-NEXT:    s_and_b64 exec, exec, s[12:13]1018; GFX6789-NEXT:    image_sample_cl v[0:3], v[0:1], s[0:7], s[8:11] dmask:0xf1019; GFX6789-NEXT:    s_waitcnt vmcnt(0)1020; GFX6789-NEXT:    ; return to shader part epilog1021;1022; GFX10PLUS-LABEL: sample_cl_1d:1023; GFX10PLUS:       ; %bb.0: ; %main_body1024; GFX10PLUS-NEXT:    s_mov_b32 s12, exec_lo1025; GFX10PLUS-NEXT:    s_wqm_b32 exec_lo, exec_lo1026; GFX10PLUS-NEXT:    s_and_b32 exec_lo, exec_lo, s121027; GFX10PLUS-NEXT:    image_sample_cl v[0:3], v[0:1], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_1D1028; GFX10PLUS-NEXT:    s_waitcnt vmcnt(0)1029; GFX10PLUS-NEXT:    ; return to shader part epilog1030;1031; GFX12-LABEL: sample_cl_1d:1032; GFX12:       ; %bb.0: ; %main_body1033; GFX12-NEXT:    s_mov_b32 s12, exec_lo1034; GFX12-NEXT:    s_wqm_b32 exec_lo, exec_lo1035; GFX12-NEXT:    s_and_b32 exec_lo, exec_lo, s121036; GFX12-NEXT:    image_sample_cl v[0:3], [v0, v1], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_1D1037; GFX12-NEXT:    s_wait_samplecnt 0x01038; GFX12-NEXT:    ; return to shader part epilog1039main_body:1040  %v = call <4 x float> @llvm.amdgcn.image.sample.cl.1d.v4f32.f32(i32 15, float %s, float %clamp, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)1041  ret <4 x float> %v1042}1043 1044define amdgpu_ps <4 x float> @sample_cl_2d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %s, float %t, float %clamp) {1045; VERDE-LABEL: sample_cl_2d:1046; VERDE:       ; %bb.0: ; %main_body1047; VERDE-NEXT:    s_mov_b64 s[12:13], exec1048; VERDE-NEXT:    s_wqm_b64 exec, exec1049; VERDE-NEXT:    s_and_b64 exec, exec, s[12:13]1050; VERDE-NEXT:    image_sample_cl v[0:3], v[0:2], s[0:7], s[8:11] dmask:0xf1051; VERDE-NEXT:    s_waitcnt vmcnt(0)1052; VERDE-NEXT:    ; return to shader part epilog1053;1054; GFX6789-LABEL: sample_cl_2d:1055; GFX6789:       ; %bb.0: ; %main_body1056; GFX6789-NEXT:    s_mov_b64 s[12:13], exec1057; GFX6789-NEXT:    s_wqm_b64 exec, exec1058; GFX6789-NEXT:    s_and_b64 exec, exec, s[12:13]1059; GFX6789-NEXT:    image_sample_cl v[0:3], v[0:2], s[0:7], s[8:11] dmask:0xf1060; GFX6789-NEXT:    s_waitcnt vmcnt(0)1061; GFX6789-NEXT:    ; return to shader part epilog1062;1063; GFX10PLUS-LABEL: sample_cl_2d:1064; GFX10PLUS:       ; %bb.0: ; %main_body1065; GFX10PLUS-NEXT:    s_mov_b32 s12, exec_lo1066; GFX10PLUS-NEXT:    s_wqm_b32 exec_lo, exec_lo1067; GFX10PLUS-NEXT:    s_and_b32 exec_lo, exec_lo, s121068; GFX10PLUS-NEXT:    image_sample_cl v[0:3], v[0:2], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_2D1069; GFX10PLUS-NEXT:    s_waitcnt vmcnt(0)1070; GFX10PLUS-NEXT:    ; return to shader part epilog1071;1072; GFX12-LABEL: sample_cl_2d:1073; GFX12:       ; %bb.0: ; %main_body1074; GFX12-NEXT:    s_mov_b32 s12, exec_lo1075; GFX12-NEXT:    s_wqm_b32 exec_lo, exec_lo1076; GFX12-NEXT:    s_and_b32 exec_lo, exec_lo, s121077; GFX12-NEXT:    image_sample_cl v[0:3], [v0, v1, v2], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_2D1078; GFX12-NEXT:    s_wait_samplecnt 0x01079; GFX12-NEXT:    ; return to shader part epilog1080main_body:1081  %v = call <4 x float> @llvm.amdgcn.image.sample.cl.2d.v4f32.f32(i32 15, float %s, float %t, float %clamp, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)1082  ret <4 x float> %v1083}1084 1085define amdgpu_ps <4 x float> @sample_c_cl_1d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %zcompare, float %s, float %clamp) {1086; VERDE-LABEL: sample_c_cl_1d:1087; VERDE:       ; %bb.0: ; %main_body1088; VERDE-NEXT:    s_mov_b64 s[12:13], exec1089; VERDE-NEXT:    s_wqm_b64 exec, exec1090; VERDE-NEXT:    s_and_b64 exec, exec, s[12:13]1091; VERDE-NEXT:    image_sample_c_cl v[0:3], v[0:2], s[0:7], s[8:11] dmask:0xf1092; VERDE-NEXT:    s_waitcnt vmcnt(0)1093; VERDE-NEXT:    ; return to shader part epilog1094;1095; GFX6789-LABEL: sample_c_cl_1d:1096; GFX6789:       ; %bb.0: ; %main_body1097; GFX6789-NEXT:    s_mov_b64 s[12:13], exec1098; GFX6789-NEXT:    s_wqm_b64 exec, exec1099; GFX6789-NEXT:    s_and_b64 exec, exec, s[12:13]1100; GFX6789-NEXT:    image_sample_c_cl v[0:3], v[0:2], s[0:7], s[8:11] dmask:0xf1101; GFX6789-NEXT:    s_waitcnt vmcnt(0)1102; GFX6789-NEXT:    ; return to shader part epilog1103;1104; GFX10PLUS-LABEL: sample_c_cl_1d:1105; GFX10PLUS:       ; %bb.0: ; %main_body1106; GFX10PLUS-NEXT:    s_mov_b32 s12, exec_lo1107; GFX10PLUS-NEXT:    s_wqm_b32 exec_lo, exec_lo1108; GFX10PLUS-NEXT:    s_and_b32 exec_lo, exec_lo, s121109; GFX10PLUS-NEXT:    image_sample_c_cl v[0:3], v[0:2], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_1D1110; GFX10PLUS-NEXT:    s_waitcnt vmcnt(0)1111; GFX10PLUS-NEXT:    ; return to shader part epilog1112;1113; GFX12-LABEL: sample_c_cl_1d:1114; GFX12:       ; %bb.0: ; %main_body1115; GFX12-NEXT:    s_mov_b32 s12, exec_lo1116; GFX12-NEXT:    s_wqm_b32 exec_lo, exec_lo1117; GFX12-NEXT:    s_and_b32 exec_lo, exec_lo, s121118; GFX12-NEXT:    image_sample_c_cl v[0:3], [v0, v1, v2], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_1D1119; GFX12-NEXT:    s_wait_samplecnt 0x01120; GFX12-NEXT:    ; return to shader part epilog1121main_body:1122  %v = call <4 x float> @llvm.amdgcn.image.sample.c.cl.1d.v4f32.f32(i32 15, float %zcompare, float %s, float %clamp, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)1123  ret <4 x float> %v1124}1125 1126define amdgpu_ps <4 x float> @sample_c_cl_2d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %zcompare, float %s, float %t, float %clamp) {1127; VERDE-LABEL: sample_c_cl_2d:1128; VERDE:       ; %bb.0: ; %main_body1129; VERDE-NEXT:    s_mov_b64 s[12:13], exec1130; VERDE-NEXT:    s_wqm_b64 exec, exec1131; VERDE-NEXT:    s_and_b64 exec, exec, s[12:13]1132; VERDE-NEXT:    image_sample_c_cl v[0:3], v[0:3], s[0:7], s[8:11] dmask:0xf1133; VERDE-NEXT:    s_waitcnt vmcnt(0)1134; VERDE-NEXT:    ; return to shader part epilog1135;1136; GFX6789-LABEL: sample_c_cl_2d:1137; GFX6789:       ; %bb.0: ; %main_body1138; GFX6789-NEXT:    s_mov_b64 s[12:13], exec1139; GFX6789-NEXT:    s_wqm_b64 exec, exec1140; GFX6789-NEXT:    s_and_b64 exec, exec, s[12:13]1141; GFX6789-NEXT:    image_sample_c_cl v[0:3], v[0:3], s[0:7], s[8:11] dmask:0xf1142; GFX6789-NEXT:    s_waitcnt vmcnt(0)1143; GFX6789-NEXT:    ; return to shader part epilog1144;1145; GFX10PLUS-LABEL: sample_c_cl_2d:1146; GFX10PLUS:       ; %bb.0: ; %main_body1147; GFX10PLUS-NEXT:    s_mov_b32 s12, exec_lo1148; GFX10PLUS-NEXT:    s_wqm_b32 exec_lo, exec_lo1149; GFX10PLUS-NEXT:    s_and_b32 exec_lo, exec_lo, s121150; GFX10PLUS-NEXT:    image_sample_c_cl v[0:3], v[0:3], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_2D1151; GFX10PLUS-NEXT:    s_waitcnt vmcnt(0)1152; GFX10PLUS-NEXT:    ; return to shader part epilog1153;1154; GFX12-LABEL: sample_c_cl_2d:1155; GFX12:       ; %bb.0: ; %main_body1156; GFX12-NEXT:    s_mov_b32 s12, exec_lo1157; GFX12-NEXT:    s_wqm_b32 exec_lo, exec_lo1158; GFX12-NEXT:    s_and_b32 exec_lo, exec_lo, s121159; GFX12-NEXT:    image_sample_c_cl v[0:3], [v0, v1, v2, v3], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_2D1160; GFX12-NEXT:    s_wait_samplecnt 0x01161; GFX12-NEXT:    ; return to shader part epilog1162main_body:1163  %v = call <4 x float> @llvm.amdgcn.image.sample.c.cl.2d.v4f32.f32(i32 15, float %zcompare, float %s, float %t, float %clamp, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)1164  ret <4 x float> %v1165}1166 1167define amdgpu_ps <4 x float> @sample_b_1d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %bias, float %s) {1168; VERDE-LABEL: sample_b_1d:1169; VERDE:       ; %bb.0: ; %main_body1170; VERDE-NEXT:    s_mov_b64 s[12:13], exec1171; VERDE-NEXT:    s_wqm_b64 exec, exec1172; VERDE-NEXT:    s_and_b64 exec, exec, s[12:13]1173; VERDE-NEXT:    image_sample_b v[0:3], v[0:1], s[0:7], s[8:11] dmask:0xf1174; VERDE-NEXT:    s_waitcnt vmcnt(0)1175; VERDE-NEXT:    ; return to shader part epilog1176;1177; GFX6789-LABEL: sample_b_1d:1178; GFX6789:       ; %bb.0: ; %main_body1179; GFX6789-NEXT:    s_mov_b64 s[12:13], exec1180; GFX6789-NEXT:    s_wqm_b64 exec, exec1181; GFX6789-NEXT:    s_and_b64 exec, exec, s[12:13]1182; GFX6789-NEXT:    image_sample_b v[0:3], v[0:1], s[0:7], s[8:11] dmask:0xf1183; GFX6789-NEXT:    s_waitcnt vmcnt(0)1184; GFX6789-NEXT:    ; return to shader part epilog1185;1186; GFX10PLUS-LABEL: sample_b_1d:1187; GFX10PLUS:       ; %bb.0: ; %main_body1188; GFX10PLUS-NEXT:    s_mov_b32 s12, exec_lo1189; GFX10PLUS-NEXT:    s_wqm_b32 exec_lo, exec_lo1190; GFX10PLUS-NEXT:    s_and_b32 exec_lo, exec_lo, s121191; GFX10PLUS-NEXT:    image_sample_b v[0:3], v[0:1], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_1D1192; GFX10PLUS-NEXT:    s_waitcnt vmcnt(0)1193; GFX10PLUS-NEXT:    ; return to shader part epilog1194;1195; GFX12-LABEL: sample_b_1d:1196; GFX12:       ; %bb.0: ; %main_body1197; GFX12-NEXT:    s_mov_b32 s12, exec_lo1198; GFX12-NEXT:    s_wqm_b32 exec_lo, exec_lo1199; GFX12-NEXT:    s_and_b32 exec_lo, exec_lo, s121200; GFX12-NEXT:    image_sample_b v[0:3], [v0, v1], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_1D1201; GFX12-NEXT:    s_wait_samplecnt 0x01202; GFX12-NEXT:    ; return to shader part epilog1203main_body:1204  %v = call <4 x float> @llvm.amdgcn.image.sample.b.1d.v4f32.f32.f32(i32 15, float %bias, float %s, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)1205  ret <4 x float> %v1206}1207 1208define amdgpu_ps <4 x float> @sample_b_2d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %bias, float %s, float %t) {1209; VERDE-LABEL: sample_b_2d:1210; VERDE:       ; %bb.0: ; %main_body1211; VERDE-NEXT:    s_mov_b64 s[12:13], exec1212; VERDE-NEXT:    s_wqm_b64 exec, exec1213; VERDE-NEXT:    s_and_b64 exec, exec, s[12:13]1214; VERDE-NEXT:    image_sample_b v[0:3], v[0:2], s[0:7], s[8:11] dmask:0xf1215; VERDE-NEXT:    s_waitcnt vmcnt(0)1216; VERDE-NEXT:    ; return to shader part epilog1217;1218; GFX6789-LABEL: sample_b_2d:1219; GFX6789:       ; %bb.0: ; %main_body1220; GFX6789-NEXT:    s_mov_b64 s[12:13], exec1221; GFX6789-NEXT:    s_wqm_b64 exec, exec1222; GFX6789-NEXT:    s_and_b64 exec, exec, s[12:13]1223; GFX6789-NEXT:    image_sample_b v[0:3], v[0:2], s[0:7], s[8:11] dmask:0xf1224; GFX6789-NEXT:    s_waitcnt vmcnt(0)1225; GFX6789-NEXT:    ; return to shader part epilog1226;1227; GFX10PLUS-LABEL: sample_b_2d:1228; GFX10PLUS:       ; %bb.0: ; %main_body1229; GFX10PLUS-NEXT:    s_mov_b32 s12, exec_lo1230; GFX10PLUS-NEXT:    s_wqm_b32 exec_lo, exec_lo1231; GFX10PLUS-NEXT:    s_and_b32 exec_lo, exec_lo, s121232; GFX10PLUS-NEXT:    image_sample_b v[0:3], v[0:2], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_2D1233; GFX10PLUS-NEXT:    s_waitcnt vmcnt(0)1234; GFX10PLUS-NEXT:    ; return to shader part epilog1235;1236; GFX12-LABEL: sample_b_2d:1237; GFX12:       ; %bb.0: ; %main_body1238; GFX12-NEXT:    s_mov_b32 s12, exec_lo1239; GFX12-NEXT:    s_wqm_b32 exec_lo, exec_lo1240; GFX12-NEXT:    s_and_b32 exec_lo, exec_lo, s121241; GFX12-NEXT:    image_sample_b v[0:3], [v0, v1, v2], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_2D1242; GFX12-NEXT:    s_wait_samplecnt 0x01243; GFX12-NEXT:    ; return to shader part epilog1244main_body:1245  %v = call <4 x float> @llvm.amdgcn.image.sample.b.2d.v4f32.f32.f32(i32 15, float %bias, float %s, float %t, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)1246  ret <4 x float> %v1247}1248 1249define amdgpu_ps <4 x float> @sample_c_b_1d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %bias, float %zcompare, float %s) {1250; VERDE-LABEL: sample_c_b_1d:1251; VERDE:       ; %bb.0: ; %main_body1252; VERDE-NEXT:    s_mov_b64 s[12:13], exec1253; VERDE-NEXT:    s_wqm_b64 exec, exec1254; VERDE-NEXT:    s_and_b64 exec, exec, s[12:13]1255; VERDE-NEXT:    image_sample_c_b v[0:3], v[0:2], s[0:7], s[8:11] dmask:0xf1256; VERDE-NEXT:    s_waitcnt vmcnt(0)1257; VERDE-NEXT:    ; return to shader part epilog1258;1259; GFX6789-LABEL: sample_c_b_1d:1260; GFX6789:       ; %bb.0: ; %main_body1261; GFX6789-NEXT:    s_mov_b64 s[12:13], exec1262; GFX6789-NEXT:    s_wqm_b64 exec, exec1263; GFX6789-NEXT:    s_and_b64 exec, exec, s[12:13]1264; GFX6789-NEXT:    image_sample_c_b v[0:3], v[0:2], s[0:7], s[8:11] dmask:0xf1265; GFX6789-NEXT:    s_waitcnt vmcnt(0)1266; GFX6789-NEXT:    ; return to shader part epilog1267;1268; GFX10PLUS-LABEL: sample_c_b_1d:1269; GFX10PLUS:       ; %bb.0: ; %main_body1270; GFX10PLUS-NEXT:    s_mov_b32 s12, exec_lo1271; GFX10PLUS-NEXT:    s_wqm_b32 exec_lo, exec_lo1272; GFX10PLUS-NEXT:    s_and_b32 exec_lo, exec_lo, s121273; GFX10PLUS-NEXT:    image_sample_c_b v[0:3], v[0:2], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_1D1274; GFX10PLUS-NEXT:    s_waitcnt vmcnt(0)1275; GFX10PLUS-NEXT:    ; return to shader part epilog1276;1277; GFX12-LABEL: sample_c_b_1d:1278; GFX12:       ; %bb.0: ; %main_body1279; GFX12-NEXT:    s_mov_b32 s12, exec_lo1280; GFX12-NEXT:    s_wqm_b32 exec_lo, exec_lo1281; GFX12-NEXT:    s_and_b32 exec_lo, exec_lo, s121282; GFX12-NEXT:    image_sample_c_b v[0:3], [v0, v1, v2], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_1D1283; GFX12-NEXT:    s_wait_samplecnt 0x01284; GFX12-NEXT:    ; return to shader part epilog1285main_body:1286  %v = call <4 x float> @llvm.amdgcn.image.sample.c.b.1d.v4f32.f32.f32(i32 15, float %bias, float %zcompare, float %s, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)1287  ret <4 x float> %v1288}1289 1290define amdgpu_ps <4 x float> @sample_c_b_2d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %bias, float %zcompare, float %s, float %t) {1291; VERDE-LABEL: sample_c_b_2d:1292; VERDE:       ; %bb.0: ; %main_body1293; VERDE-NEXT:    s_mov_b64 s[12:13], exec1294; VERDE-NEXT:    s_wqm_b64 exec, exec1295; VERDE-NEXT:    s_and_b64 exec, exec, s[12:13]1296; VERDE-NEXT:    image_sample_c_b v[0:3], v[0:3], s[0:7], s[8:11] dmask:0xf1297; VERDE-NEXT:    s_waitcnt vmcnt(0)1298; VERDE-NEXT:    ; return to shader part epilog1299;1300; GFX6789-LABEL: sample_c_b_2d:1301; GFX6789:       ; %bb.0: ; %main_body1302; GFX6789-NEXT:    s_mov_b64 s[12:13], exec1303; GFX6789-NEXT:    s_wqm_b64 exec, exec1304; GFX6789-NEXT:    s_and_b64 exec, exec, s[12:13]1305; GFX6789-NEXT:    image_sample_c_b v[0:3], v[0:3], s[0:7], s[8:11] dmask:0xf1306; GFX6789-NEXT:    s_waitcnt vmcnt(0)1307; GFX6789-NEXT:    ; return to shader part epilog1308;1309; GFX10PLUS-LABEL: sample_c_b_2d:1310; GFX10PLUS:       ; %bb.0: ; %main_body1311; GFX10PLUS-NEXT:    s_mov_b32 s12, exec_lo1312; GFX10PLUS-NEXT:    s_wqm_b32 exec_lo, exec_lo1313; GFX10PLUS-NEXT:    s_and_b32 exec_lo, exec_lo, s121314; GFX10PLUS-NEXT:    image_sample_c_b v[0:3], v[0:3], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_2D1315; GFX10PLUS-NEXT:    s_waitcnt vmcnt(0)1316; GFX10PLUS-NEXT:    ; return to shader part epilog1317;1318; GFX12-LABEL: sample_c_b_2d:1319; GFX12:       ; %bb.0: ; %main_body1320; GFX12-NEXT:    s_mov_b32 s12, exec_lo1321; GFX12-NEXT:    s_wqm_b32 exec_lo, exec_lo1322; GFX12-NEXT:    s_and_b32 exec_lo, exec_lo, s121323; GFX12-NEXT:    image_sample_c_b v[0:3], [v0, v1, v2, v3], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_2D1324; GFX12-NEXT:    s_wait_samplecnt 0x01325; GFX12-NEXT:    ; return to shader part epilog1326main_body:1327  %v = call <4 x float> @llvm.amdgcn.image.sample.c.b.2d.v4f32.f32.f32(i32 15, float %bias, float %zcompare, float %s, float %t, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)1328  ret <4 x float> %v1329}1330 1331define amdgpu_ps <4 x float> @sample_b_cl_1d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %bias, float %s, float %clamp) {1332; VERDE-LABEL: sample_b_cl_1d:1333; VERDE:       ; %bb.0: ; %main_body1334; VERDE-NEXT:    s_mov_b64 s[12:13], exec1335; VERDE-NEXT:    s_wqm_b64 exec, exec1336; VERDE-NEXT:    s_and_b64 exec, exec, s[12:13]1337; VERDE-NEXT:    image_sample_b_cl v[0:3], v[0:2], s[0:7], s[8:11] dmask:0xf1338; VERDE-NEXT:    s_waitcnt vmcnt(0)1339; VERDE-NEXT:    ; return to shader part epilog1340;1341; GFX6789-LABEL: sample_b_cl_1d:1342; GFX6789:       ; %bb.0: ; %main_body1343; GFX6789-NEXT:    s_mov_b64 s[12:13], exec1344; GFX6789-NEXT:    s_wqm_b64 exec, exec1345; GFX6789-NEXT:    s_and_b64 exec, exec, s[12:13]1346; GFX6789-NEXT:    image_sample_b_cl v[0:3], v[0:2], s[0:7], s[8:11] dmask:0xf1347; GFX6789-NEXT:    s_waitcnt vmcnt(0)1348; GFX6789-NEXT:    ; return to shader part epilog1349;1350; GFX10PLUS-LABEL: sample_b_cl_1d:1351; GFX10PLUS:       ; %bb.0: ; %main_body1352; GFX10PLUS-NEXT:    s_mov_b32 s12, exec_lo1353; GFX10PLUS-NEXT:    s_wqm_b32 exec_lo, exec_lo1354; GFX10PLUS-NEXT:    s_and_b32 exec_lo, exec_lo, s121355; GFX10PLUS-NEXT:    image_sample_b_cl v[0:3], v[0:2], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_1D1356; GFX10PLUS-NEXT:    s_waitcnt vmcnt(0)1357; GFX10PLUS-NEXT:    ; return to shader part epilog1358;1359; GFX12-LABEL: sample_b_cl_1d:1360; GFX12:       ; %bb.0: ; %main_body1361; GFX12-NEXT:    s_mov_b32 s12, exec_lo1362; GFX12-NEXT:    s_wqm_b32 exec_lo, exec_lo1363; GFX12-NEXT:    s_and_b32 exec_lo, exec_lo, s121364; GFX12-NEXT:    image_sample_b_cl v[0:3], [v0, v1, v2], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_1D1365; GFX12-NEXT:    s_wait_samplecnt 0x01366; GFX12-NEXT:    ; return to shader part epilog1367main_body:1368  %v = call <4 x float> @llvm.amdgcn.image.sample.b.cl.1d.v4f32.f32.f32(i32 15, float %bias, float %s, float %clamp, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)1369  ret <4 x float> %v1370}1371 1372define amdgpu_ps <4 x float> @sample_b_cl_2d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %bias, float %s, float %t, float %clamp) {1373; VERDE-LABEL: sample_b_cl_2d:1374; VERDE:       ; %bb.0: ; %main_body1375; VERDE-NEXT:    s_mov_b64 s[12:13], exec1376; VERDE-NEXT:    s_wqm_b64 exec, exec1377; VERDE-NEXT:    s_and_b64 exec, exec, s[12:13]1378; VERDE-NEXT:    image_sample_b_cl v[0:3], v[0:3], s[0:7], s[8:11] dmask:0xf1379; VERDE-NEXT:    s_waitcnt vmcnt(0)1380; VERDE-NEXT:    ; return to shader part epilog1381;1382; GFX6789-LABEL: sample_b_cl_2d:1383; GFX6789:       ; %bb.0: ; %main_body1384; GFX6789-NEXT:    s_mov_b64 s[12:13], exec1385; GFX6789-NEXT:    s_wqm_b64 exec, exec1386; GFX6789-NEXT:    s_and_b64 exec, exec, s[12:13]1387; GFX6789-NEXT:    image_sample_b_cl v[0:3], v[0:3], s[0:7], s[8:11] dmask:0xf1388; GFX6789-NEXT:    s_waitcnt vmcnt(0)1389; GFX6789-NEXT:    ; return to shader part epilog1390;1391; GFX10PLUS-LABEL: sample_b_cl_2d:1392; GFX10PLUS:       ; %bb.0: ; %main_body1393; GFX10PLUS-NEXT:    s_mov_b32 s12, exec_lo1394; GFX10PLUS-NEXT:    s_wqm_b32 exec_lo, exec_lo1395; GFX10PLUS-NEXT:    s_and_b32 exec_lo, exec_lo, s121396; GFX10PLUS-NEXT:    image_sample_b_cl v[0:3], v[0:3], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_2D1397; GFX10PLUS-NEXT:    s_waitcnt vmcnt(0)1398; GFX10PLUS-NEXT:    ; return to shader part epilog1399;1400; GFX12-LABEL: sample_b_cl_2d:1401; GFX12:       ; %bb.0: ; %main_body1402; GFX12-NEXT:    s_mov_b32 s12, exec_lo1403; GFX12-NEXT:    s_wqm_b32 exec_lo, exec_lo1404; GFX12-NEXT:    s_and_b32 exec_lo, exec_lo, s121405; GFX12-NEXT:    image_sample_b_cl v[0:3], [v0, v1, v2, v3], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_2D1406; GFX12-NEXT:    s_wait_samplecnt 0x01407; GFX12-NEXT:    ; return to shader part epilog1408main_body:1409  %v = call <4 x float> @llvm.amdgcn.image.sample.b.cl.2d.v4f32.f32.f32(i32 15, float %bias, float %s, float %t, float %clamp, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)1410  ret <4 x float> %v1411}1412 1413define amdgpu_ps <4 x float> @sample_c_b_cl_1d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %bias, float %zcompare, float %s, float %clamp) {1414; VERDE-LABEL: sample_c_b_cl_1d:1415; VERDE:       ; %bb.0: ; %main_body1416; VERDE-NEXT:    s_mov_b64 s[12:13], exec1417; VERDE-NEXT:    s_wqm_b64 exec, exec1418; VERDE-NEXT:    s_and_b64 exec, exec, s[12:13]1419; VERDE-NEXT:    image_sample_c_b_cl v[0:3], v[0:3], s[0:7], s[8:11] dmask:0xf1420; VERDE-NEXT:    s_waitcnt vmcnt(0)1421; VERDE-NEXT:    ; return to shader part epilog1422;1423; GFX6789-LABEL: sample_c_b_cl_1d:1424; GFX6789:       ; %bb.0: ; %main_body1425; GFX6789-NEXT:    s_mov_b64 s[12:13], exec1426; GFX6789-NEXT:    s_wqm_b64 exec, exec1427; GFX6789-NEXT:    s_and_b64 exec, exec, s[12:13]1428; GFX6789-NEXT:    image_sample_c_b_cl v[0:3], v[0:3], s[0:7], s[8:11] dmask:0xf1429; GFX6789-NEXT:    s_waitcnt vmcnt(0)1430; GFX6789-NEXT:    ; return to shader part epilog1431;1432; GFX10PLUS-LABEL: sample_c_b_cl_1d:1433; GFX10PLUS:       ; %bb.0: ; %main_body1434; GFX10PLUS-NEXT:    s_mov_b32 s12, exec_lo1435; GFX10PLUS-NEXT:    s_wqm_b32 exec_lo, exec_lo1436; GFX10PLUS-NEXT:    s_and_b32 exec_lo, exec_lo, s121437; GFX10PLUS-NEXT:    image_sample_c_b_cl v[0:3], v[0:3], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_1D1438; GFX10PLUS-NEXT:    s_waitcnt vmcnt(0)1439; GFX10PLUS-NEXT:    ; return to shader part epilog1440;1441; GFX12-LABEL: sample_c_b_cl_1d:1442; GFX12:       ; %bb.0: ; %main_body1443; GFX12-NEXT:    s_mov_b32 s12, exec_lo1444; GFX12-NEXT:    s_wqm_b32 exec_lo, exec_lo1445; GFX12-NEXT:    s_and_b32 exec_lo, exec_lo, s121446; GFX12-NEXT:    image_sample_c_b_cl v[0:3], [v0, v1, v2, v3], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_1D1447; GFX12-NEXT:    s_wait_samplecnt 0x01448; GFX12-NEXT:    ; return to shader part epilog1449main_body:1450  %v = call <4 x float> @llvm.amdgcn.image.sample.c.b.cl.1d.v4f32.f32.f32(i32 15, float %bias, float %zcompare, float %s, float %clamp, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)1451  ret <4 x float> %v1452}1453 1454define amdgpu_ps <4 x float> @sample_c_b_cl_2d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %bias, float %zcompare, float %s, float %t, float %clamp) {1455; VERDE-LABEL: sample_c_b_cl_2d:1456; VERDE:       ; %bb.0: ; %main_body1457; VERDE-NEXT:    s_mov_b64 s[12:13], exec1458; VERDE-NEXT:    s_wqm_b64 exec, exec1459; VERDE-NEXT:    s_and_b64 exec, exec, s[12:13]1460; VERDE-NEXT:    image_sample_c_b_cl v[0:3], v[0:4], s[0:7], s[8:11] dmask:0xf1461; VERDE-NEXT:    s_waitcnt vmcnt(0)1462; VERDE-NEXT:    ; return to shader part epilog1463;1464; GFX6789-LABEL: sample_c_b_cl_2d:1465; GFX6789:       ; %bb.0: ; %main_body1466; GFX6789-NEXT:    s_mov_b64 s[12:13], exec1467; GFX6789-NEXT:    s_wqm_b64 exec, exec1468; GFX6789-NEXT:    s_and_b64 exec, exec, s[12:13]1469; GFX6789-NEXT:    image_sample_c_b_cl v[0:3], v[0:4], s[0:7], s[8:11] dmask:0xf1470; GFX6789-NEXT:    s_waitcnt vmcnt(0)1471; GFX6789-NEXT:    ; return to shader part epilog1472;1473; GFX10PLUS-LABEL: sample_c_b_cl_2d:1474; GFX10PLUS:       ; %bb.0: ; %main_body1475; GFX10PLUS-NEXT:    s_mov_b32 s12, exec_lo1476; GFX10PLUS-NEXT:    s_wqm_b32 exec_lo, exec_lo1477; GFX10PLUS-NEXT:    s_and_b32 exec_lo, exec_lo, s121478; GFX10PLUS-NEXT:    image_sample_c_b_cl v[0:3], v[0:4], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_2D1479; GFX10PLUS-NEXT:    s_waitcnt vmcnt(0)1480; GFX10PLUS-NEXT:    ; return to shader part epilog1481;1482; GFX12-LABEL: sample_c_b_cl_2d:1483; GFX12:       ; %bb.0: ; %main_body1484; GFX12-NEXT:    s_mov_b32 s12, exec_lo1485; GFX12-NEXT:    s_wqm_b32 exec_lo, exec_lo1486; GFX12-NEXT:    s_and_b32 exec_lo, exec_lo, s121487; GFX12-NEXT:    image_sample_c_b_cl v[0:3], [v0, v1, v2, v[3:4]], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_2D1488; GFX12-NEXT:    s_wait_samplecnt 0x01489; GFX12-NEXT:    ; return to shader part epilog1490main_body:1491  %v = call <4 x float> @llvm.amdgcn.image.sample.c.b.cl.2d.v4f32.f32.f32(i32 15, float %bias, float %zcompare, float %s, float %t, float %clamp, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)1492  ret <4 x float> %v1493}1494 1495define amdgpu_ps <4 x float> @sample_d_1d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %dsdh, float %dsdv, float %s) {1496; VERDE-LABEL: sample_d_1d:1497; VERDE:       ; %bb.0: ; %main_body1498; VERDE-NEXT:    image_sample_d v[0:3], v[0:2], s[0:7], s[8:11] dmask:0xf1499; VERDE-NEXT:    s_waitcnt vmcnt(0)1500; VERDE-NEXT:    ; return to shader part epilog1501;1502; GFX6789-LABEL: sample_d_1d:1503; GFX6789:       ; %bb.0: ; %main_body1504; GFX6789-NEXT:    image_sample_d v[0:3], v[0:2], s[0:7], s[8:11] dmask:0xf1505; GFX6789-NEXT:    s_waitcnt vmcnt(0)1506; GFX6789-NEXT:    ; return to shader part epilog1507;1508; GFX10PLUS-LABEL: sample_d_1d:1509; GFX10PLUS:       ; %bb.0: ; %main_body1510; GFX10PLUS-NEXT:    image_sample_d v[0:3], v[0:2], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_1D1511; GFX10PLUS-NEXT:    s_waitcnt vmcnt(0)1512; GFX10PLUS-NEXT:    ; return to shader part epilog1513;1514; GFX12-LABEL: sample_d_1d:1515; GFX12:       ; %bb.0: ; %main_body1516; GFX12-NEXT:    image_sample_d v[0:3], [v0, v1, v2], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_1D1517; GFX12-NEXT:    s_wait_samplecnt 0x01518; GFX12-NEXT:    ; return to shader part epilog1519main_body:1520  %v = call <4 x float> @llvm.amdgcn.image.sample.d.1d.v4f32.f32.f32(i32 15, float %dsdh, float %dsdv, float %s, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)1521  ret <4 x float> %v1522}1523 1524define amdgpu_ps <4 x float> @sample_d_2d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %dsdh, float %dtdh, float %dsdv, float %dtdv, float %s, float %t) {1525; VERDE-LABEL: sample_d_2d:1526; VERDE:       ; %bb.0: ; %main_body1527; VERDE-NEXT:    image_sample_d v[0:3], v[0:5], s[0:7], s[8:11] dmask:0xf1528; VERDE-NEXT:    s_waitcnt vmcnt(0)1529; VERDE-NEXT:    ; return to shader part epilog1530;1531; GFX6789-LABEL: sample_d_2d:1532; GFX6789:       ; %bb.0: ; %main_body1533; GFX6789-NEXT:    image_sample_d v[0:3], v[0:5], s[0:7], s[8:11] dmask:0xf1534; GFX6789-NEXT:    s_waitcnt vmcnt(0)1535; GFX6789-NEXT:    ; return to shader part epilog1536;1537; GFX10PLUS-LABEL: sample_d_2d:1538; GFX10PLUS:       ; %bb.0: ; %main_body1539; GFX10PLUS-NEXT:    image_sample_d v[0:3], v[0:5], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_2D1540; GFX10PLUS-NEXT:    s_waitcnt vmcnt(0)1541; GFX10PLUS-NEXT:    ; return to shader part epilog1542;1543; GFX12-LABEL: sample_d_2d:1544; GFX12:       ; %bb.0: ; %main_body1545; GFX12-NEXT:    image_sample_d v[0:3], [v0, v1, v2, v[3:5]], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_2D1546; GFX12-NEXT:    s_wait_samplecnt 0x01547; GFX12-NEXT:    ; return to shader part epilog1548main_body:1549  %v = call <4 x float> @llvm.amdgcn.image.sample.d.2d.v4f32.f32.f32(i32 15, float %dsdh, float %dtdh, float %dsdv, float %dtdv, float %s, float %t, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)1550  ret <4 x float> %v1551}1552 1553define amdgpu_ps <4 x float> @sample_c_d_1d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %zcompare, float %dsdh, float %dsdv, float %s) {1554; VERDE-LABEL: sample_c_d_1d:1555; VERDE:       ; %bb.0: ; %main_body1556; VERDE-NEXT:    image_sample_c_d v[0:3], v[0:3], s[0:7], s[8:11] dmask:0xf1557; VERDE-NEXT:    s_waitcnt vmcnt(0)1558; VERDE-NEXT:    ; return to shader part epilog1559;1560; GFX6789-LABEL: sample_c_d_1d:1561; GFX6789:       ; %bb.0: ; %main_body1562; GFX6789-NEXT:    image_sample_c_d v[0:3], v[0:3], s[0:7], s[8:11] dmask:0xf1563; GFX6789-NEXT:    s_waitcnt vmcnt(0)1564; GFX6789-NEXT:    ; return to shader part epilog1565;1566; GFX10PLUS-LABEL: sample_c_d_1d:1567; GFX10PLUS:       ; %bb.0: ; %main_body1568; GFX10PLUS-NEXT:    image_sample_c_d v[0:3], v[0:3], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_1D1569; GFX10PLUS-NEXT:    s_waitcnt vmcnt(0)1570; GFX10PLUS-NEXT:    ; return to shader part epilog1571;1572; GFX12-LABEL: sample_c_d_1d:1573; GFX12:       ; %bb.0: ; %main_body1574; GFX12-NEXT:    image_sample_c_d v[0:3], [v0, v1, v2, v3], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_1D1575; GFX12-NEXT:    s_wait_samplecnt 0x01576; GFX12-NEXT:    ; return to shader part epilog1577main_body:1578  %v = call <4 x float> @llvm.amdgcn.image.sample.c.d.1d.v4f32.f32.f32(i32 15, float %zcompare, float %dsdh, float %dsdv, float %s, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)1579  ret <4 x float> %v1580}1581 1582define amdgpu_ps <4 x float> @sample_c_d_2d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %zcompare, float %dsdh, float %dtdh, float %dsdv, float %dtdv, float %s, float %t) {1583; VERDE-LABEL: sample_c_d_2d:1584; VERDE:       ; %bb.0: ; %main_body1585; VERDE-NEXT:    image_sample_c_d v[0:3], v[0:6], s[0:7], s[8:11] dmask:0xf1586; VERDE-NEXT:    s_waitcnt vmcnt(0)1587; VERDE-NEXT:    ; return to shader part epilog1588;1589; GFX6789-LABEL: sample_c_d_2d:1590; GFX6789:       ; %bb.0: ; %main_body1591; GFX6789-NEXT:    image_sample_c_d v[0:3], v[0:6], s[0:7], s[8:11] dmask:0xf1592; GFX6789-NEXT:    s_waitcnt vmcnt(0)1593; GFX6789-NEXT:    ; return to shader part epilog1594;1595; GFX10PLUS-LABEL: sample_c_d_2d:1596; GFX10PLUS:       ; %bb.0: ; %main_body1597; GFX10PLUS-NEXT:    image_sample_c_d v[0:3], v[0:6], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_2D1598; GFX10PLUS-NEXT:    s_waitcnt vmcnt(0)1599; GFX10PLUS-NEXT:    ; return to shader part epilog1600;1601; GFX12-LABEL: sample_c_d_2d:1602; GFX12:       ; %bb.0: ; %main_body1603; GFX12-NEXT:    image_sample_c_d v[0:3], [v0, v1, v2, v[3:6]], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_2D1604; GFX12-NEXT:    s_wait_samplecnt 0x01605; GFX12-NEXT:    ; return to shader part epilog1606main_body:1607  %v = call <4 x float> @llvm.amdgcn.image.sample.c.d.2d.v4f32.f32.f32(i32 15, float %zcompare, float %dsdh, float %dtdh, float %dsdv, float %dtdv, float %s, float %t, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)1608  ret <4 x float> %v1609}1610 1611define amdgpu_ps <4 x float> @sample_d_cl_1d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %dsdh, float %dsdv, float %s, float %clamp) {1612; VERDE-LABEL: sample_d_cl_1d:1613; VERDE:       ; %bb.0: ; %main_body1614; VERDE-NEXT:    image_sample_d_cl v[0:3], v[0:3], s[0:7], s[8:11] dmask:0xf1615; VERDE-NEXT:    s_waitcnt vmcnt(0)1616; VERDE-NEXT:    ; return to shader part epilog1617;1618; GFX6789-LABEL: sample_d_cl_1d:1619; GFX6789:       ; %bb.0: ; %main_body1620; GFX6789-NEXT:    image_sample_d_cl v[0:3], v[0:3], s[0:7], s[8:11] dmask:0xf1621; GFX6789-NEXT:    s_waitcnt vmcnt(0)1622; GFX6789-NEXT:    ; return to shader part epilog1623;1624; GFX10PLUS-LABEL: sample_d_cl_1d:1625; GFX10PLUS:       ; %bb.0: ; %main_body1626; GFX10PLUS-NEXT:    image_sample_d_cl v[0:3], v[0:3], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_1D1627; GFX10PLUS-NEXT:    s_waitcnt vmcnt(0)1628; GFX10PLUS-NEXT:    ; return to shader part epilog1629;1630; GFX12-LABEL: sample_d_cl_1d:1631; GFX12:       ; %bb.0: ; %main_body1632; GFX12-NEXT:    image_sample_d_cl v[0:3], [v0, v1, v2, v3], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_1D1633; GFX12-NEXT:    s_wait_samplecnt 0x01634; GFX12-NEXT:    ; return to shader part epilog1635main_body:1636  %v = call <4 x float> @llvm.amdgcn.image.sample.d.cl.1d.v4f32.f32.f32(i32 15, float %dsdh, float %dsdv, float %s, float %clamp, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)1637  ret <4 x float> %v1638}1639 1640define amdgpu_ps <4 x float> @sample_d_cl_2d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %dsdh, float %dtdh, float %dsdv, float %dtdv, float %s, float %t, float %clamp) {1641; VERDE-LABEL: sample_d_cl_2d:1642; VERDE:       ; %bb.0: ; %main_body1643; VERDE-NEXT:    image_sample_d_cl v[0:3], v[0:6], s[0:7], s[8:11] dmask:0xf1644; VERDE-NEXT:    s_waitcnt vmcnt(0)1645; VERDE-NEXT:    ; return to shader part epilog1646;1647; GFX6789-LABEL: sample_d_cl_2d:1648; GFX6789:       ; %bb.0: ; %main_body1649; GFX6789-NEXT:    image_sample_d_cl v[0:3], v[0:6], s[0:7], s[8:11] dmask:0xf1650; GFX6789-NEXT:    s_waitcnt vmcnt(0)1651; GFX6789-NEXT:    ; return to shader part epilog1652;1653; GFX10PLUS-LABEL: sample_d_cl_2d:1654; GFX10PLUS:       ; %bb.0: ; %main_body1655; GFX10PLUS-NEXT:    image_sample_d_cl v[0:3], v[0:6], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_2D1656; GFX10PLUS-NEXT:    s_waitcnt vmcnt(0)1657; GFX10PLUS-NEXT:    ; return to shader part epilog1658;1659; GFX12-LABEL: sample_d_cl_2d:1660; GFX12:       ; %bb.0: ; %main_body1661; GFX12-NEXT:    image_sample_d_cl v[0:3], [v0, v1, v2, v[3:6]], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_2D1662; GFX12-NEXT:    s_wait_samplecnt 0x01663; GFX12-NEXT:    ; return to shader part epilog1664main_body:1665  %v = call <4 x float> @llvm.amdgcn.image.sample.d.cl.2d.v4f32.f32.f32(i32 15, float %dsdh, float %dtdh, float %dsdv, float %dtdv, float %s, float %t, float %clamp, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)1666  ret <4 x float> %v1667}1668 1669define amdgpu_ps <4 x float> @sample_c_d_cl_1d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %zcompare, float %dsdh, float %dsdv, float %s, float %clamp) {1670; VERDE-LABEL: sample_c_d_cl_1d:1671; VERDE:       ; %bb.0: ; %main_body1672; VERDE-NEXT:    image_sample_c_d_cl v[0:3], v[0:4], s[0:7], s[8:11] dmask:0xf1673; VERDE-NEXT:    s_waitcnt vmcnt(0)1674; VERDE-NEXT:    ; return to shader part epilog1675;1676; GFX6789-LABEL: sample_c_d_cl_1d:1677; GFX6789:       ; %bb.0: ; %main_body1678; GFX6789-NEXT:    image_sample_c_d_cl v[0:3], v[0:4], s[0:7], s[8:11] dmask:0xf1679; GFX6789-NEXT:    s_waitcnt vmcnt(0)1680; GFX6789-NEXT:    ; return to shader part epilog1681;1682; GFX10PLUS-LABEL: sample_c_d_cl_1d:1683; GFX10PLUS:       ; %bb.0: ; %main_body1684; GFX10PLUS-NEXT:    image_sample_c_d_cl v[0:3], v[0:4], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_1D1685; GFX10PLUS-NEXT:    s_waitcnt vmcnt(0)1686; GFX10PLUS-NEXT:    ; return to shader part epilog1687;1688; GFX12-LABEL: sample_c_d_cl_1d:1689; GFX12:       ; %bb.0: ; %main_body1690; GFX12-NEXT:    image_sample_c_d_cl v[0:3], [v0, v1, v2, v[3:4]], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_1D1691; GFX12-NEXT:    s_wait_samplecnt 0x01692; GFX12-NEXT:    ; return to shader part epilog1693main_body:1694  %v = call <4 x float> @llvm.amdgcn.image.sample.c.d.cl.1d.v4f32.f32.f32(i32 15, float %zcompare, float %dsdh, float %dsdv, float %s, float %clamp, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)1695  ret <4 x float> %v1696}1697 1698define amdgpu_ps <4 x float> @sample_c_d_cl_2d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %zcompare, float %dsdh, float %dtdh, float %dsdv, float %dtdv, float %s, float %t, float %clamp) {1699; VERDE-LABEL: sample_c_d_cl_2d:1700; VERDE:       ; %bb.0: ; %main_body1701; VERDE-NEXT:    image_sample_c_d_cl v[0:3], v[0:7], s[0:7], s[8:11] dmask:0xf1702; VERDE-NEXT:    s_waitcnt vmcnt(0)1703; VERDE-NEXT:    ; return to shader part epilog1704;1705; GFX6789-LABEL: sample_c_d_cl_2d:1706; GFX6789:       ; %bb.0: ; %main_body1707; GFX6789-NEXT:    image_sample_c_d_cl v[0:3], v[0:7], s[0:7], s[8:11] dmask:0xf1708; GFX6789-NEXT:    s_waitcnt vmcnt(0)1709; GFX6789-NEXT:    ; return to shader part epilog1710;1711; GFX10PLUS-LABEL: sample_c_d_cl_2d:1712; GFX10PLUS:       ; %bb.0: ; %main_body1713; GFX10PLUS-NEXT:    image_sample_c_d_cl v[0:3], v[0:7], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_2D1714; GFX10PLUS-NEXT:    s_waitcnt vmcnt(0)1715; GFX10PLUS-NEXT:    ; return to shader part epilog1716;1717; GFX12-LABEL: sample_c_d_cl_2d:1718; GFX12:       ; %bb.0: ; %main_body1719; GFX12-NEXT:    image_sample_c_d_cl v[0:3], [v0, v1, v2, v[3:7]], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_2D1720; GFX12-NEXT:    s_wait_samplecnt 0x01721; GFX12-NEXT:    ; return to shader part epilog1722main_body:1723  %v = call <4 x float> @llvm.amdgcn.image.sample.c.d.cl.2d.v4f32.f32.f32(i32 15, float %zcompare, float %dsdh, float %dtdh, float %dsdv, float %dtdv, float %s, float %t, float %clamp, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)1724  ret <4 x float> %v1725}1726 1727define amdgpu_ps <4 x float> @sample_l_1d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %s, float %lod) {1728; VERDE-LABEL: sample_l_1d:1729; VERDE:       ; %bb.0: ; %main_body1730; VERDE-NEXT:    image_sample_l v[0:3], v[0:1], s[0:7], s[8:11] dmask:0xf1731; VERDE-NEXT:    s_waitcnt vmcnt(0)1732; VERDE-NEXT:    ; return to shader part epilog1733;1734; GFX6789-LABEL: sample_l_1d:1735; GFX6789:       ; %bb.0: ; %main_body1736; GFX6789-NEXT:    image_sample_l v[0:3], v[0:1], s[0:7], s[8:11] dmask:0xf1737; GFX6789-NEXT:    s_waitcnt vmcnt(0)1738; GFX6789-NEXT:    ; return to shader part epilog1739;1740; GFX10PLUS-LABEL: sample_l_1d:1741; GFX10PLUS:       ; %bb.0: ; %main_body1742; GFX10PLUS-NEXT:    image_sample_l v[0:3], v[0:1], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_1D1743; GFX10PLUS-NEXT:    s_waitcnt vmcnt(0)1744; GFX10PLUS-NEXT:    ; return to shader part epilog1745;1746; GFX12-LABEL: sample_l_1d:1747; GFX12:       ; %bb.0: ; %main_body1748; GFX12-NEXT:    image_sample_l v[0:3], [v0, v1], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_1D1749; GFX12-NEXT:    s_wait_samplecnt 0x01750; GFX12-NEXT:    ; return to shader part epilog1751main_body:1752  %v = call <4 x float> @llvm.amdgcn.image.sample.l.1d.v4f32.f32(i32 15, float %s, float %lod, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)1753  ret <4 x float> %v1754}1755 1756define amdgpu_ps <4 x float> @sample_l_2d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %s, float %t, float %lod) {1757; VERDE-LABEL: sample_l_2d:1758; VERDE:       ; %bb.0: ; %main_body1759; VERDE-NEXT:    image_sample_l v[0:3], v[0:2], s[0:7], s[8:11] dmask:0xf1760; VERDE-NEXT:    s_waitcnt vmcnt(0)1761; VERDE-NEXT:    ; return to shader part epilog1762;1763; GFX6789-LABEL: sample_l_2d:1764; GFX6789:       ; %bb.0: ; %main_body1765; GFX6789-NEXT:    image_sample_l v[0:3], v[0:2], s[0:7], s[8:11] dmask:0xf1766; GFX6789-NEXT:    s_waitcnt vmcnt(0)1767; GFX6789-NEXT:    ; return to shader part epilog1768;1769; GFX10PLUS-LABEL: sample_l_2d:1770; GFX10PLUS:       ; %bb.0: ; %main_body1771; GFX10PLUS-NEXT:    image_sample_l v[0:3], v[0:2], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_2D1772; GFX10PLUS-NEXT:    s_waitcnt vmcnt(0)1773; GFX10PLUS-NEXT:    ; return to shader part epilog1774;1775; GFX12-LABEL: sample_l_2d:1776; GFX12:       ; %bb.0: ; %main_body1777; GFX12-NEXT:    image_sample_l v[0:3], [v0, v1, v2], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_2D1778; GFX12-NEXT:    s_wait_samplecnt 0x01779; GFX12-NEXT:    ; return to shader part epilog1780main_body:1781  %v = call <4 x float> @llvm.amdgcn.image.sample.l.2d.v4f32.f32(i32 15, float %s, float %t, float %lod, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)1782  ret <4 x float> %v1783}1784 1785define amdgpu_ps <4 x float> @sample_c_l_1d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %zcompare, float %s, float %lod) {1786; VERDE-LABEL: sample_c_l_1d:1787; VERDE:       ; %bb.0: ; %main_body1788; VERDE-NEXT:    image_sample_c_l v[0:3], v[0:2], s[0:7], s[8:11] dmask:0xf1789; VERDE-NEXT:    s_waitcnt vmcnt(0)1790; VERDE-NEXT:    ; return to shader part epilog1791;1792; GFX6789-LABEL: sample_c_l_1d:1793; GFX6789:       ; %bb.0: ; %main_body1794; GFX6789-NEXT:    image_sample_c_l v[0:3], v[0:2], s[0:7], s[8:11] dmask:0xf1795; GFX6789-NEXT:    s_waitcnt vmcnt(0)1796; GFX6789-NEXT:    ; return to shader part epilog1797;1798; GFX10PLUS-LABEL: sample_c_l_1d:1799; GFX10PLUS:       ; %bb.0: ; %main_body1800; GFX10PLUS-NEXT:    image_sample_c_l v[0:3], v[0:2], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_1D1801; GFX10PLUS-NEXT:    s_waitcnt vmcnt(0)1802; GFX10PLUS-NEXT:    ; return to shader part epilog1803;1804; GFX12-LABEL: sample_c_l_1d:1805; GFX12:       ; %bb.0: ; %main_body1806; GFX12-NEXT:    image_sample_c_l v[0:3], [v0, v1, v2], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_1D1807; GFX12-NEXT:    s_wait_samplecnt 0x01808; GFX12-NEXT:    ; return to shader part epilog1809main_body:1810  %v = call <4 x float> @llvm.amdgcn.image.sample.c.l.1d.v4f32.f32(i32 15, float %zcompare, float %s, float %lod, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)1811  ret <4 x float> %v1812}1813 1814define amdgpu_ps <4 x float> @sample_c_l_2d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %zcompare, float %s, float %t, float %lod) {1815; VERDE-LABEL: sample_c_l_2d:1816; VERDE:       ; %bb.0: ; %main_body1817; VERDE-NEXT:    image_sample_c_l v[0:3], v[0:3], s[0:7], s[8:11] dmask:0xf1818; VERDE-NEXT:    s_waitcnt vmcnt(0)1819; VERDE-NEXT:    ; return to shader part epilog1820;1821; GFX6789-LABEL: sample_c_l_2d:1822; GFX6789:       ; %bb.0: ; %main_body1823; GFX6789-NEXT:    image_sample_c_l v[0:3], v[0:3], s[0:7], s[8:11] dmask:0xf1824; GFX6789-NEXT:    s_waitcnt vmcnt(0)1825; GFX6789-NEXT:    ; return to shader part epilog1826;1827; GFX10PLUS-LABEL: sample_c_l_2d:1828; GFX10PLUS:       ; %bb.0: ; %main_body1829; GFX10PLUS-NEXT:    image_sample_c_l v[0:3], v[0:3], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_2D1830; GFX10PLUS-NEXT:    s_waitcnt vmcnt(0)1831; GFX10PLUS-NEXT:    ; return to shader part epilog1832;1833; GFX12-LABEL: sample_c_l_2d:1834; GFX12:       ; %bb.0: ; %main_body1835; GFX12-NEXT:    image_sample_c_l v[0:3], [v0, v1, v2, v3], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_2D1836; GFX12-NEXT:    s_wait_samplecnt 0x01837; GFX12-NEXT:    ; return to shader part epilog1838main_body:1839  %v = call <4 x float> @llvm.amdgcn.image.sample.c.l.2d.v4f32.f32(i32 15, float %zcompare, float %s, float %t, float %lod, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)1840  ret <4 x float> %v1841}1842 1843define amdgpu_ps <4 x float> @sample_lz_1d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %s) {1844; VERDE-LABEL: sample_lz_1d:1845; VERDE:       ; %bb.0: ; %main_body1846; VERDE-NEXT:    image_sample_lz v[0:3], v0, s[0:7], s[8:11] dmask:0xf1847; VERDE-NEXT:    s_waitcnt vmcnt(0)1848; VERDE-NEXT:    ; return to shader part epilog1849;1850; GFX6789-LABEL: sample_lz_1d:1851; GFX6789:       ; %bb.0: ; %main_body1852; GFX6789-NEXT:    image_sample_lz v[0:3], v0, s[0:7], s[8:11] dmask:0xf1853; GFX6789-NEXT:    s_waitcnt vmcnt(0)1854; GFX6789-NEXT:    ; return to shader part epilog1855;1856; GFX10PLUS-LABEL: sample_lz_1d:1857; GFX10PLUS:       ; %bb.0: ; %main_body1858; GFX10PLUS-NEXT:    image_sample_lz v[0:3], v0, s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_1D1859; GFX10PLUS-NEXT:    s_waitcnt vmcnt(0)1860; GFX10PLUS-NEXT:    ; return to shader part epilog1861;1862; GFX12-LABEL: sample_lz_1d:1863; GFX12:       ; %bb.0: ; %main_body1864; GFX12-NEXT:    image_sample_lz v[0:3], v0, s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_1D1865; GFX12-NEXT:    s_wait_samplecnt 0x01866; GFX12-NEXT:    ; return to shader part epilog1867main_body:1868  %v = call <4 x float> @llvm.amdgcn.image.sample.lz.1d.v4f32.f32(i32 15, float %s, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)1869  ret <4 x float> %v1870}1871 1872define amdgpu_ps <4 x float> @sample_lz_2d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %s, float %t) {1873; VERDE-LABEL: sample_lz_2d:1874; VERDE:       ; %bb.0: ; %main_body1875; VERDE-NEXT:    image_sample_lz v[0:3], v[0:1], s[0:7], s[8:11] dmask:0xf1876; VERDE-NEXT:    s_waitcnt vmcnt(0)1877; VERDE-NEXT:    ; return to shader part epilog1878;1879; GFX6789-LABEL: sample_lz_2d:1880; GFX6789:       ; %bb.0: ; %main_body1881; GFX6789-NEXT:    image_sample_lz v[0:3], v[0:1], s[0:7], s[8:11] dmask:0xf1882; GFX6789-NEXT:    s_waitcnt vmcnt(0)1883; GFX6789-NEXT:    ; return to shader part epilog1884;1885; GFX10PLUS-LABEL: sample_lz_2d:1886; GFX10PLUS:       ; %bb.0: ; %main_body1887; GFX10PLUS-NEXT:    image_sample_lz v[0:3], v[0:1], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_2D1888; GFX10PLUS-NEXT:    s_waitcnt vmcnt(0)1889; GFX10PLUS-NEXT:    ; return to shader part epilog1890;1891; GFX12-LABEL: sample_lz_2d:1892; GFX12:       ; %bb.0: ; %main_body1893; GFX12-NEXT:    image_sample_lz v[0:3], [v0, v1], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_2D1894; GFX12-NEXT:    s_wait_samplecnt 0x01895; GFX12-NEXT:    ; return to shader part epilog1896main_body:1897  %v = call <4 x float> @llvm.amdgcn.image.sample.lz.2d.v4f32.f32(i32 15, float %s, float %t, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)1898  ret <4 x float> %v1899}1900 1901define amdgpu_ps <4 x float> @sample_c_lz_1d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %zcompare, float %s) {1902; VERDE-LABEL: sample_c_lz_1d:1903; VERDE:       ; %bb.0: ; %main_body1904; VERDE-NEXT:    image_sample_c_lz v[0:3], v[0:1], s[0:7], s[8:11] dmask:0xf1905; VERDE-NEXT:    s_waitcnt vmcnt(0)1906; VERDE-NEXT:    ; return to shader part epilog1907;1908; GFX6789-LABEL: sample_c_lz_1d:1909; GFX6789:       ; %bb.0: ; %main_body1910; GFX6789-NEXT:    image_sample_c_lz v[0:3], v[0:1], s[0:7], s[8:11] dmask:0xf1911; GFX6789-NEXT:    s_waitcnt vmcnt(0)1912; GFX6789-NEXT:    ; return to shader part epilog1913;1914; GFX10PLUS-LABEL: sample_c_lz_1d:1915; GFX10PLUS:       ; %bb.0: ; %main_body1916; GFX10PLUS-NEXT:    image_sample_c_lz v[0:3], v[0:1], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_1D1917; GFX10PLUS-NEXT:    s_waitcnt vmcnt(0)1918; GFX10PLUS-NEXT:    ; return to shader part epilog1919;1920; GFX12-LABEL: sample_c_lz_1d:1921; GFX12:       ; %bb.0: ; %main_body1922; GFX12-NEXT:    image_sample_c_lz v[0:3], [v0, v1], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_1D1923; GFX12-NEXT:    s_wait_samplecnt 0x01924; GFX12-NEXT:    ; return to shader part epilog1925main_body:1926  %v = call <4 x float> @llvm.amdgcn.image.sample.c.lz.1d.v4f32.f32(i32 15, float %zcompare, float %s, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)1927  ret <4 x float> %v1928}1929 1930define amdgpu_ps <4 x float> @sample_c_lz_2d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %zcompare, float %s, float %t) {1931; VERDE-LABEL: sample_c_lz_2d:1932; VERDE:       ; %bb.0: ; %main_body1933; VERDE-NEXT:    image_sample_c_lz v[0:3], v[0:2], s[0:7], s[8:11] dmask:0xf1934; VERDE-NEXT:    s_waitcnt vmcnt(0)1935; VERDE-NEXT:    ; return to shader part epilog1936;1937; GFX6789-LABEL: sample_c_lz_2d:1938; GFX6789:       ; %bb.0: ; %main_body1939; GFX6789-NEXT:    image_sample_c_lz v[0:3], v[0:2], s[0:7], s[8:11] dmask:0xf1940; GFX6789-NEXT:    s_waitcnt vmcnt(0)1941; GFX6789-NEXT:    ; return to shader part epilog1942;1943; GFX10PLUS-LABEL: sample_c_lz_2d:1944; GFX10PLUS:       ; %bb.0: ; %main_body1945; GFX10PLUS-NEXT:    image_sample_c_lz v[0:3], v[0:2], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_2D1946; GFX10PLUS-NEXT:    s_waitcnt vmcnt(0)1947; GFX10PLUS-NEXT:    ; return to shader part epilog1948;1949; GFX12-LABEL: sample_c_lz_2d:1950; GFX12:       ; %bb.0: ; %main_body1951; GFX12-NEXT:    image_sample_c_lz v[0:3], [v0, v1, v2], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_2D1952; GFX12-NEXT:    s_wait_samplecnt 0x01953; GFX12-NEXT:    ; return to shader part epilog1954main_body:1955  %v = call <4 x float> @llvm.amdgcn.image.sample.c.lz.2d.v4f32.f32(i32 15, float %zcompare, float %s, float %t, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)1956  ret <4 x float> %v1957}1958 1959define amdgpu_ps float @sample_c_d_o_2darray_V1(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, i32 %offset, float %zcompare, float %dsdh, float %dtdh, float %dsdv, float %dtdv, float %s, float %t, float %slice) {1960; VERDE-LABEL: sample_c_d_o_2darray_V1:1961; VERDE:       ; %bb.0: ; %main_body1962; VERDE-NEXT:    image_sample_c_d_o v0, v[0:8], s[0:7], s[8:11] dmask:0x4 da1963; VERDE-NEXT:    s_waitcnt vmcnt(0)1964; VERDE-NEXT:    ; return to shader part epilog1965;1966; GFX6789-LABEL: sample_c_d_o_2darray_V1:1967; GFX6789:       ; %bb.0: ; %main_body1968; GFX6789-NEXT:    image_sample_c_d_o v0, v[0:8], s[0:7], s[8:11] dmask:0x4 da1969; GFX6789-NEXT:    s_waitcnt vmcnt(0)1970; GFX6789-NEXT:    ; return to shader part epilog1971;1972; GFX10PLUS-LABEL: sample_c_d_o_2darray_V1:1973; GFX10PLUS:       ; %bb.0: ; %main_body1974; GFX10PLUS-NEXT:    image_sample_c_d_o v0, v[0:8], s[0:7], s[8:11] dmask:0x4 dim:SQ_RSRC_IMG_2D_ARRAY1975; GFX10PLUS-NEXT:    s_waitcnt vmcnt(0)1976; GFX10PLUS-NEXT:    ; return to shader part epilog1977;1978; GFX12-LABEL: sample_c_d_o_2darray_V1:1979; GFX12:       ; %bb.0: ; %main_body1980; GFX12-NEXT:    image_sample_c_d_o v0, [v0, v1, v2, v[3:8]], s[0:7], s[8:11] dmask:0x4 dim:SQ_RSRC_IMG_2D_ARRAY1981; GFX12-NEXT:    s_wait_samplecnt 0x01982; GFX12-NEXT:    ; return to shader part epilog1983main_body:1984  %v = call float @llvm.amdgcn.image.sample.c.d.o.2darray.f32.f32.f32(i32 4, i32 %offset, float %zcompare, float %dsdh, float %dtdh, float %dsdv, float %dtdv, float %s, float %t, float %slice, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)1985  ret float %v1986}1987 1988define amdgpu_ps float @sample_c_d_o_2darray_V1_tfe(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, i32 %offset, float %zcompare, float %dsdh, float %dtdh, float %dsdv, float %dtdv, float %s, float %t, float %slice, ptr addrspace(1) inreg %out) {1989; VERDE-LABEL: sample_c_d_o_2darray_V1_tfe:1990; VERDE:       ; %bb.0: ; %main_body1991; VERDE-NEXT:    v_mov_b32_e32 v9, 01992; VERDE-NEXT:    v_mov_b32_e32 v10, v91993; VERDE-NEXT:    image_sample_c_d_o v[9:10], v[0:8], s[0:7], s[8:11] dmask:0x4 tfe da1994; VERDE-NEXT:    s_mov_b32 s15, 0xf0001995; VERDE-NEXT:    s_mov_b32 s14, -11996; VERDE-NEXT:    s_waitcnt vmcnt(0)1997; VERDE-NEXT:    v_mov_b32_e32 v0, v91998; VERDE-NEXT:    buffer_store_dword v10, off, s[12:15], 01999; VERDE-NEXT:    s_waitcnt vmcnt(0) expcnt(0)2000; VERDE-NEXT:    ; return to shader part epilog2001;2002; GFX6789-LABEL: sample_c_d_o_2darray_V1_tfe:2003; GFX6789:       ; %bb.0: ; %main_body2004; GFX6789-NEXT:    v_mov_b32_e32 v11, 02005; GFX6789-NEXT:    v_mov_b32_e32 v12, v112006; GFX6789-NEXT:    v_mov_b32_e32 v9, v112007; GFX6789-NEXT:    v_mov_b32_e32 v10, v122008; GFX6789-NEXT:    image_sample_c_d_o v[9:10], v[0:8], s[0:7], s[8:11] dmask:0x4 tfe da2009; GFX6789-NEXT:    s_waitcnt vmcnt(0)2010; GFX6789-NEXT:    v_mov_b32_e32 v0, v92011; GFX6789-NEXT:    global_store_dword v11, v10, s[12:13]2012; GFX6789-NEXT:    s_waitcnt vmcnt(0)2013; GFX6789-NEXT:    ; return to shader part epilog2014;2015; GFX10-LABEL: sample_c_d_o_2darray_V1_tfe:2016; GFX10:       ; %bb.0: ; %main_body2017; GFX10-NEXT:    v_mov_b32_e32 v11, 02018; GFX10-NEXT:    v_mov_b32_e32 v12, v112019; GFX10-NEXT:    v_mov_b32_e32 v9, v112020; GFX10-NEXT:    v_mov_b32_e32 v10, v122021; GFX10-NEXT:    image_sample_c_d_o v[9:10], v[0:8], s[0:7], s[8:11] dmask:0x4 dim:SQ_RSRC_IMG_2D_ARRAY tfe2022; GFX10-NEXT:    s_waitcnt vmcnt(0)2023; GFX10-NEXT:    v_mov_b32_e32 v0, v92024; GFX10-NEXT:    global_store_dword v11, v10, s[12:13]2025; GFX10-NEXT:    ; return to shader part epilog2026;2027; GFX11-LABEL: sample_c_d_o_2darray_V1_tfe:2028; GFX11:       ; %bb.0: ; %main_body2029; GFX11-NEXT:    v_mov_b32_e32 v11, 02030; GFX11-NEXT:    v_dual_mov_b32 v9, v1 :: v_dual_mov_b32 v10, v02031; GFX11-NEXT:    v_mov_b32_e32 v12, v112032; GFX11-NEXT:    v_dual_mov_b32 v0, v11 :: v_dual_mov_b32 v1, v122033; GFX11-NEXT:    image_sample_c_d_o v[0:1], [v10, v9, v2, v3, v[4:8]], s[0:7], s[8:11] dmask:0x4 dim:SQ_RSRC_IMG_2D_ARRAY tfe2034; GFX11-NEXT:    s_waitcnt vmcnt(0)2035; GFX11-NEXT:    global_store_b32 v11, v1, s[12:13]2036; GFX11-NEXT:    ; return to shader part epilog2037;2038; GFX12-LABEL: sample_c_d_o_2darray_V1_tfe:2039; GFX12:       ; %bb.0: ; %main_body2040; GFX12-NEXT:    v_mov_b32_e32 v11, 02041; GFX12-NEXT:    v_dual_mov_b32 v9, v1 :: v_dual_mov_b32 v10, v02042; GFX12-NEXT:    v_mov_b32_e32 v12, v112043; GFX12-NEXT:    v_dual_mov_b32 v0, v11 :: v_dual_mov_b32 v1, v122044; GFX12-NEXT:    image_sample_c_d_o v[0:1], [v10, v9, v2, v[3:8]], s[0:7], s[8:11] dmask:0x4 dim:SQ_RSRC_IMG_2D_ARRAY tfe2045; GFX12-NEXT:    s_wait_samplecnt 0x02046; GFX12-NEXT:    global_store_b32 v11, v1, s[12:13]2047; GFX12-NEXT:    ; return to shader part epilog2048main_body:2049  %v = call {float,i32} @llvm.amdgcn.image.sample.c.d.o.2darray.f32i32.f32.f32(i32 4, i32 %offset, float %zcompare, float %dsdh, float %dtdh, float %dsdv, float %dtdv, float %s, float %t, float %slice, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 1, i32 0)2050  %v.vec = extractvalue {float, i32} %v, 02051  %v.err = extractvalue {float, i32} %v, 12052  store i32 %v.err, ptr addrspace(1) %out, align 42053  ret float %v.vec2054}2055 2056define amdgpu_ps <2 x float> @sample_c_d_o_2darray_V2(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, i32 %offset, float %zcompare, float %dsdh, float %dtdh, float %dsdv, float %dtdv, float %s, float %t, float %slice) {2057; VERDE-LABEL: sample_c_d_o_2darray_V2:2058; VERDE:       ; %bb.0: ; %main_body2059; VERDE-NEXT:    image_sample_c_d_o v[0:1], v[0:8], s[0:7], s[8:11] dmask:0x6 da2060; VERDE-NEXT:    s_waitcnt vmcnt(0)2061; VERDE-NEXT:    ; return to shader part epilog2062;2063; GFX6789-LABEL: sample_c_d_o_2darray_V2:2064; GFX6789:       ; %bb.0: ; %main_body2065; GFX6789-NEXT:    image_sample_c_d_o v[0:1], v[0:8], s[0:7], s[8:11] dmask:0x6 da2066; GFX6789-NEXT:    s_waitcnt vmcnt(0)2067; GFX6789-NEXT:    ; return to shader part epilog2068;2069; GFX10PLUS-LABEL: sample_c_d_o_2darray_V2:2070; GFX10PLUS:       ; %bb.0: ; %main_body2071; GFX10PLUS-NEXT:    image_sample_c_d_o v[0:1], v[0:8], s[0:7], s[8:11] dmask:0x6 dim:SQ_RSRC_IMG_2D_ARRAY2072; GFX10PLUS-NEXT:    s_waitcnt vmcnt(0)2073; GFX10PLUS-NEXT:    ; return to shader part epilog2074;2075; GFX12-LABEL: sample_c_d_o_2darray_V2:2076; GFX12:       ; %bb.0: ; %main_body2077; GFX12-NEXT:    image_sample_c_d_o v[0:1], [v0, v1, v2, v[3:8]], s[0:7], s[8:11] dmask:0x6 dim:SQ_RSRC_IMG_2D_ARRAY2078; GFX12-NEXT:    s_wait_samplecnt 0x02079; GFX12-NEXT:    ; return to shader part epilog2080main_body:2081  %v = call <2 x float> @llvm.amdgcn.image.sample.c.d.o.2darray.v2f32.f32.f32(i32 6, i32 %offset, float %zcompare, float %dsdh, float %dtdh, float %dsdv, float %dtdv, float %s, float %t, float %slice, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)2082  ret <2 x float> %v2083}2084 2085define amdgpu_ps <4 x float> @sample_c_d_o_2darray_V2_tfe(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, i32 %offset, float %zcompare, float %dsdh, float %dtdh, float %dsdv, float %dtdv, float %s, float %t, float %slice) {2086; VERDE-LABEL: sample_c_d_o_2darray_V2_tfe:2087; VERDE:       ; %bb.0: ; %main_body2088; VERDE-NEXT:    v_mov_b32_e32 v9, 02089; VERDE-NEXT:    v_mov_b32_e32 v10, v92090; VERDE-NEXT:    v_mov_b32_e32 v11, v92091; VERDE-NEXT:    image_sample_c_d_o v[9:11], v[0:8], s[0:7], s[8:11] dmask:0x6 tfe da2092; VERDE-NEXT:    s_waitcnt vmcnt(0)2093; VERDE-NEXT:    v_mov_b32_e32 v0, v92094; VERDE-NEXT:    v_mov_b32_e32 v1, v102095; VERDE-NEXT:    v_mov_b32_e32 v2, v112096; VERDE-NEXT:    ; return to shader part epilog2097;2098; GFX6789-LABEL: sample_c_d_o_2darray_V2_tfe:2099; GFX6789:       ; %bb.0: ; %main_body2100; GFX6789-NEXT:    v_mov_b32_e32 v9, 02101; GFX6789-NEXT:    v_mov_b32_e32 v10, v92102; GFX6789-NEXT:    v_mov_b32_e32 v11, v92103; GFX6789-NEXT:    image_sample_c_d_o v[9:11], v[0:8], s[0:7], s[8:11] dmask:0x6 tfe da2104; GFX6789-NEXT:    s_waitcnt vmcnt(0)2105; GFX6789-NEXT:    v_mov_b32_e32 v0, v92106; GFX6789-NEXT:    v_mov_b32_e32 v1, v102107; GFX6789-NEXT:    v_mov_b32_e32 v2, v112108; GFX6789-NEXT:    ; return to shader part epilog2109;2110; GFX10-LABEL: sample_c_d_o_2darray_V2_tfe:2111; GFX10:       ; %bb.0: ; %main_body2112; GFX10-NEXT:    v_mov_b32_e32 v9, 02113; GFX10-NEXT:    v_mov_b32_e32 v10, v92114; GFX10-NEXT:    v_mov_b32_e32 v11, v92115; GFX10-NEXT:    image_sample_c_d_o v[9:11], v[0:8], s[0:7], s[8:11] dmask:0x6 dim:SQ_RSRC_IMG_2D_ARRAY tfe2116; GFX10-NEXT:    s_waitcnt vmcnt(0)2117; GFX10-NEXT:    v_mov_b32_e32 v0, v92118; GFX10-NEXT:    v_mov_b32_e32 v1, v102119; GFX10-NEXT:    v_mov_b32_e32 v2, v112120; GFX10-NEXT:    ; return to shader part epilog2121;2122; GFX11-LABEL: sample_c_d_o_2darray_V2_tfe:2123; GFX11:       ; %bb.0: ; %main_body2124; GFX11-NEXT:    v_dual_mov_b32 v11, v0 :: v_dual_mov_b32 v0, 02125; GFX11-NEXT:    v_dual_mov_b32 v9, v2 :: v_dual_mov_b32 v10, v12126; GFX11-NEXT:    v_mov_b32_e32 v1, v02127; GFX11-NEXT:    v_mov_b32_e32 v2, v02128; GFX11-NEXT:    image_sample_c_d_o v[0:2], [v11, v10, v9, v3, v[4:8]], s[0:7], s[8:11] dmask:0x6 dim:SQ_RSRC_IMG_2D_ARRAY tfe2129; GFX11-NEXT:    s_waitcnt vmcnt(0)2130; GFX11-NEXT:    ; return to shader part epilog2131;2132; GFX12-LABEL: sample_c_d_o_2darray_V2_tfe:2133; GFX12:       ; %bb.0: ; %main_body2134; GFX12-NEXT:    v_dual_mov_b32 v11, v0 :: v_dual_mov_b32 v0, 02135; GFX12-NEXT:    v_dual_mov_b32 v9, v2 :: v_dual_mov_b32 v10, v12136; GFX12-NEXT:    v_dual_mov_b32 v1, v0 :: v_dual_mov_b32 v2, v02137; GFX12-NEXT:    image_sample_c_d_o v[0:2], [v11, v10, v9, v[3:8]], s[0:7], s[8:11] dmask:0x6 dim:SQ_RSRC_IMG_2D_ARRAY tfe2138; GFX12-NEXT:    s_wait_samplecnt 0x02139; GFX12-NEXT:    ; return to shader part epilog2140main_body:2141  %v = call {<2 x float>, i32} @llvm.amdgcn.image.sample.c.d.o.2darray.v2f32i32.f32.f32(i32 6, i32 %offset, float %zcompare, float %dsdh, float %dtdh, float %dsdv, float %dtdv, float %s, float %t, float %slice, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 1, i32 0)2142  %v.vec = extractvalue {<2 x float>, i32} %v, 02143  %v.f1 = extractelement <2 x float> %v.vec, i32 02144  %v.f2 = extractelement <2 x float> %v.vec, i32 12145  %v.err = extractvalue {<2 x float>, i32} %v, 12146  %v.errf = bitcast i32 %v.err to float2147  %res.0 = insertelement <4 x float> poison, float %v.f1, i32 02148  %res.1 = insertelement <4 x float> %res.0, float %v.f2, i32 12149  %res.2 = insertelement <4 x float> %res.1, float %v.errf, i32 22150  ret <4 x float> %res.22151}2152 2153define amdgpu_ps <4 x float> @sample_1d_unorm(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %s) {2154; VERDE-LABEL: sample_1d_unorm:2155; VERDE:       ; %bb.0: ; %main_body2156; VERDE-NEXT:    s_mov_b64 s[12:13], exec2157; VERDE-NEXT:    s_wqm_b64 exec, exec2158; VERDE-NEXT:    s_and_b64 exec, exec, s[12:13]2159; VERDE-NEXT:    image_sample v[0:3], v0, s[0:7], s[8:11] dmask:0xf unorm2160; VERDE-NEXT:    s_waitcnt vmcnt(0)2161; VERDE-NEXT:    ; return to shader part epilog2162;2163; GFX6789-LABEL: sample_1d_unorm:2164; GFX6789:       ; %bb.0: ; %main_body2165; GFX6789-NEXT:    s_mov_b64 s[12:13], exec2166; GFX6789-NEXT:    s_wqm_b64 exec, exec2167; GFX6789-NEXT:    s_and_b64 exec, exec, s[12:13]2168; GFX6789-NEXT:    image_sample v[0:3], v0, s[0:7], s[8:11] dmask:0xf unorm2169; GFX6789-NEXT:    s_waitcnt vmcnt(0)2170; GFX6789-NEXT:    ; return to shader part epilog2171;2172; GFX10PLUS-LABEL: sample_1d_unorm:2173; GFX10PLUS:       ; %bb.0: ; %main_body2174; GFX10PLUS-NEXT:    s_mov_b32 s12, exec_lo2175; GFX10PLUS-NEXT:    s_wqm_b32 exec_lo, exec_lo2176; GFX10PLUS-NEXT:    s_and_b32 exec_lo, exec_lo, s122177; GFX10PLUS-NEXT:    image_sample v[0:3], v0, s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_1D unorm2178; GFX10PLUS-NEXT:    s_waitcnt vmcnt(0)2179; GFX10PLUS-NEXT:    ; return to shader part epilog2180;2181; GFX12-LABEL: sample_1d_unorm:2182; GFX12:       ; %bb.0: ; %main_body2183; GFX12-NEXT:    s_mov_b32 s12, exec_lo2184; GFX12-NEXT:    s_wqm_b32 exec_lo, exec_lo2185; GFX12-NEXT:    s_and_b32 exec_lo, exec_lo, s122186; GFX12-NEXT:    image_sample v[0:3], v0, s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_1D unorm2187; GFX12-NEXT:    s_wait_samplecnt 0x02188; GFX12-NEXT:    ; return to shader part epilog2189main_body:2190  %v = call <4 x float> @llvm.amdgcn.image.sample.1d.v4f32.f32(i32 15, float %s, <8 x i32> %rsrc, <4 x i32> %samp, i1 1, i32 0, i32 0)2191  ret <4 x float> %v2192}2193 2194define amdgpu_ps <4 x float> @sample_1d_glc(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %s) {2195; VERDE-LABEL: sample_1d_glc:2196; VERDE:       ; %bb.0: ; %main_body2197; VERDE-NEXT:    s_mov_b64 s[12:13], exec2198; VERDE-NEXT:    s_wqm_b64 exec, exec2199; VERDE-NEXT:    s_and_b64 exec, exec, s[12:13]2200; VERDE-NEXT:    image_sample v[0:3], v0, s[0:7], s[8:11] dmask:0xf glc2201; VERDE-NEXT:    s_waitcnt vmcnt(0)2202; VERDE-NEXT:    ; return to shader part epilog2203;2204; GFX6789-LABEL: sample_1d_glc:2205; GFX6789:       ; %bb.0: ; %main_body2206; GFX6789-NEXT:    s_mov_b64 s[12:13], exec2207; GFX6789-NEXT:    s_wqm_b64 exec, exec2208; GFX6789-NEXT:    s_and_b64 exec, exec, s[12:13]2209; GFX6789-NEXT:    image_sample v[0:3], v0, s[0:7], s[8:11] dmask:0xf glc2210; GFX6789-NEXT:    s_waitcnt vmcnt(0)2211; GFX6789-NEXT:    ; return to shader part epilog2212;2213; GFX10PLUS-LABEL: sample_1d_glc:2214; GFX10PLUS:       ; %bb.0: ; %main_body2215; GFX10PLUS-NEXT:    s_mov_b32 s12, exec_lo2216; GFX10PLUS-NEXT:    s_wqm_b32 exec_lo, exec_lo2217; GFX10PLUS-NEXT:    s_and_b32 exec_lo, exec_lo, s122218; GFX10PLUS-NEXT:    image_sample v[0:3], v0, s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_1D glc2219; GFX10PLUS-NEXT:    s_waitcnt vmcnt(0)2220; GFX10PLUS-NEXT:    ; return to shader part epilog2221;2222; GFX12-LABEL: sample_1d_glc:2223; GFX12:       ; %bb.0: ; %main_body2224; GFX12-NEXT:    s_mov_b32 s12, exec_lo2225; GFX12-NEXT:    s_wqm_b32 exec_lo, exec_lo2226; GFX12-NEXT:    s_and_b32 exec_lo, exec_lo, s122227; GFX12-NEXT:    image_sample v[0:3], v0, s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_1D th:TH_LOAD_NT2228; GFX12-NEXT:    s_wait_samplecnt 0x02229; GFX12-NEXT:    ; return to shader part epilog2230main_body:2231  %v = call <4 x float> @llvm.amdgcn.image.sample.1d.v4f32.f32(i32 15, float %s, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 1)2232  ret <4 x float> %v2233}2234 2235define amdgpu_ps <4 x float> @sample_1d_slc(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %s) {2236; VERDE-LABEL: sample_1d_slc:2237; VERDE:       ; %bb.0: ; %main_body2238; VERDE-NEXT:    s_mov_b64 s[12:13], exec2239; VERDE-NEXT:    s_wqm_b64 exec, exec2240; VERDE-NEXT:    s_and_b64 exec, exec, s[12:13]2241; VERDE-NEXT:    image_sample v[0:3], v0, s[0:7], s[8:11] dmask:0xf slc2242; VERDE-NEXT:    s_waitcnt vmcnt(0)2243; VERDE-NEXT:    ; return to shader part epilog2244;2245; GFX6789-LABEL: sample_1d_slc:2246; GFX6789:       ; %bb.0: ; %main_body2247; GFX6789-NEXT:    s_mov_b64 s[12:13], exec2248; GFX6789-NEXT:    s_wqm_b64 exec, exec2249; GFX6789-NEXT:    s_and_b64 exec, exec, s[12:13]2250; GFX6789-NEXT:    image_sample v[0:3], v0, s[0:7], s[8:11] dmask:0xf slc2251; GFX6789-NEXT:    s_waitcnt vmcnt(0)2252; GFX6789-NEXT:    ; return to shader part epilog2253;2254; GFX10PLUS-LABEL: sample_1d_slc:2255; GFX10PLUS:       ; %bb.0: ; %main_body2256; GFX10PLUS-NEXT:    s_mov_b32 s12, exec_lo2257; GFX10PLUS-NEXT:    s_wqm_b32 exec_lo, exec_lo2258; GFX10PLUS-NEXT:    s_and_b32 exec_lo, exec_lo, s122259; GFX10PLUS-NEXT:    image_sample v[0:3], v0, s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_1D slc2260; GFX10PLUS-NEXT:    s_waitcnt vmcnt(0)2261; GFX10PLUS-NEXT:    ; return to shader part epilog2262;2263; GFX12-LABEL: sample_1d_slc:2264; GFX12:       ; %bb.0: ; %main_body2265; GFX12-NEXT:    s_mov_b32 s12, exec_lo2266; GFX12-NEXT:    s_wqm_b32 exec_lo, exec_lo2267; GFX12-NEXT:    s_and_b32 exec_lo, exec_lo, s122268; GFX12-NEXT:    image_sample v[0:3], v0, s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_1D th:TH_LOAD_HT2269; GFX12-NEXT:    s_wait_samplecnt 0x02270; GFX12-NEXT:    ; return to shader part epilog2271main_body:2272  %v = call <4 x float> @llvm.amdgcn.image.sample.1d.v4f32.f32(i32 15, float %s, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 2)2273  ret <4 x float> %v2274}2275 2276define amdgpu_ps <4 x float> @sample_1d_glc_slc(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %s) {2277; VERDE-LABEL: sample_1d_glc_slc:2278; VERDE:       ; %bb.0: ; %main_body2279; VERDE-NEXT:    s_mov_b64 s[12:13], exec2280; VERDE-NEXT:    s_wqm_b64 exec, exec2281; VERDE-NEXT:    s_and_b64 exec, exec, s[12:13]2282; VERDE-NEXT:    image_sample v[0:3], v0, s[0:7], s[8:11] dmask:0xf glc slc2283; VERDE-NEXT:    s_waitcnt vmcnt(0)2284; VERDE-NEXT:    ; return to shader part epilog2285;2286; GFX6789-LABEL: sample_1d_glc_slc:2287; GFX6789:       ; %bb.0: ; %main_body2288; GFX6789-NEXT:    s_mov_b64 s[12:13], exec2289; GFX6789-NEXT:    s_wqm_b64 exec, exec2290; GFX6789-NEXT:    s_and_b64 exec, exec, s[12:13]2291; GFX6789-NEXT:    image_sample v[0:3], v0, s[0:7], s[8:11] dmask:0xf glc slc2292; GFX6789-NEXT:    s_waitcnt vmcnt(0)2293; GFX6789-NEXT:    ; return to shader part epilog2294;2295; GFX10PLUS-LABEL: sample_1d_glc_slc:2296; GFX10PLUS:       ; %bb.0: ; %main_body2297; GFX10PLUS-NEXT:    s_mov_b32 s12, exec_lo2298; GFX10PLUS-NEXT:    s_wqm_b32 exec_lo, exec_lo2299; GFX10PLUS-NEXT:    s_and_b32 exec_lo, exec_lo, s122300; GFX10PLUS-NEXT:    image_sample v[0:3], v0, s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_1D glc slc2301; GFX10PLUS-NEXT:    s_waitcnt vmcnt(0)2302; GFX10PLUS-NEXT:    ; return to shader part epilog2303;2304; GFX12-LABEL: sample_1d_glc_slc:2305; GFX12:       ; %bb.0: ; %main_body2306; GFX12-NEXT:    s_mov_b32 s12, exec_lo2307; GFX12-NEXT:    s_wqm_b32 exec_lo, exec_lo2308; GFX12-NEXT:    s_and_b32 exec_lo, exec_lo, s122309; GFX12-NEXT:    image_sample v[0:3], v0, s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_1D th:TH_LOAD_LU2310; GFX12-NEXT:    s_wait_samplecnt 0x02311; GFX12-NEXT:    ; return to shader part epilog2312main_body:2313  %v = call <4 x float> @llvm.amdgcn.image.sample.1d.v4f32.f32(i32 15, float %s, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 3)2314  ret <4 x float> %v2315}2316 2317define amdgpu_ps float @adjust_writemask_sample_0(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %s) {2318; VERDE-LABEL: adjust_writemask_sample_0:2319; VERDE:       ; %bb.0: ; %main_body2320; VERDE-NEXT:    s_mov_b64 s[12:13], exec2321; VERDE-NEXT:    s_wqm_b64 exec, exec2322; VERDE-NEXT:    s_and_b64 exec, exec, s[12:13]2323; VERDE-NEXT:    image_sample v0, v0, s[0:7], s[8:11] dmask:0x12324; VERDE-NEXT:    s_waitcnt vmcnt(0)2325; VERDE-NEXT:    ; return to shader part epilog2326;2327; GFX6789-LABEL: adjust_writemask_sample_0:2328; GFX6789:       ; %bb.0: ; %main_body2329; GFX6789-NEXT:    s_mov_b64 s[12:13], exec2330; GFX6789-NEXT:    s_wqm_b64 exec, exec2331; GFX6789-NEXT:    s_and_b64 exec, exec, s[12:13]2332; GFX6789-NEXT:    image_sample v0, v0, s[0:7], s[8:11] dmask:0x12333; GFX6789-NEXT:    s_waitcnt vmcnt(0)2334; GFX6789-NEXT:    ; return to shader part epilog2335;2336; GFX10PLUS-LABEL: adjust_writemask_sample_0:2337; GFX10PLUS:       ; %bb.0: ; %main_body2338; GFX10PLUS-NEXT:    s_mov_b32 s12, exec_lo2339; GFX10PLUS-NEXT:    s_wqm_b32 exec_lo, exec_lo2340; GFX10PLUS-NEXT:    s_and_b32 exec_lo, exec_lo, s122341; GFX10PLUS-NEXT:    image_sample v0, v0, s[0:7], s[8:11] dmask:0x1 dim:SQ_RSRC_IMG_1D2342; GFX10PLUS-NEXT:    s_waitcnt vmcnt(0)2343; GFX10PLUS-NEXT:    ; return to shader part epilog2344;2345; GFX12-LABEL: adjust_writemask_sample_0:2346; GFX12:       ; %bb.0: ; %main_body2347; GFX12-NEXT:    s_mov_b32 s12, exec_lo2348; GFX12-NEXT:    s_wqm_b32 exec_lo, exec_lo2349; GFX12-NEXT:    s_and_b32 exec_lo, exec_lo, s122350; GFX12-NEXT:    image_sample v0, v0, s[0:7], s[8:11] dmask:0x1 dim:SQ_RSRC_IMG_1D2351; GFX12-NEXT:    s_wait_samplecnt 0x02352; GFX12-NEXT:    ; return to shader part epilog2353main_body:2354  %r = call <4 x float> @llvm.amdgcn.image.sample.1d.v4f32.f32(i32 15, float %s, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)2355  %elt0 = extractelement <4 x float> %r, i32 02356  ret float %elt02357}2358 2359define amdgpu_ps <2 x float> @adjust_writemask_sample_01(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %s) {2360; VERDE-LABEL: adjust_writemask_sample_01:2361; VERDE:       ; %bb.0: ; %main_body2362; VERDE-NEXT:    s_mov_b64 s[12:13], exec2363; VERDE-NEXT:    s_wqm_b64 exec, exec2364; VERDE-NEXT:    s_and_b64 exec, exec, s[12:13]2365; VERDE-NEXT:    image_sample v[0:1], v0, s[0:7], s[8:11] dmask:0x32366; VERDE-NEXT:    s_waitcnt vmcnt(0)2367; VERDE-NEXT:    ; return to shader part epilog2368;2369; GFX6789-LABEL: adjust_writemask_sample_01:2370; GFX6789:       ; %bb.0: ; %main_body2371; GFX6789-NEXT:    s_mov_b64 s[12:13], exec2372; GFX6789-NEXT:    s_wqm_b64 exec, exec2373; GFX6789-NEXT:    s_and_b64 exec, exec, s[12:13]2374; GFX6789-NEXT:    image_sample v[0:1], v0, s[0:7], s[8:11] dmask:0x32375; GFX6789-NEXT:    s_waitcnt vmcnt(0)2376; GFX6789-NEXT:    ; return to shader part epilog2377;2378; GFX10PLUS-LABEL: adjust_writemask_sample_01:2379; GFX10PLUS:       ; %bb.0: ; %main_body2380; GFX10PLUS-NEXT:    s_mov_b32 s12, exec_lo2381; GFX10PLUS-NEXT:    s_wqm_b32 exec_lo, exec_lo2382; GFX10PLUS-NEXT:    s_and_b32 exec_lo, exec_lo, s122383; GFX10PLUS-NEXT:    image_sample v[0:1], v0, s[0:7], s[8:11] dmask:0x3 dim:SQ_RSRC_IMG_1D2384; GFX10PLUS-NEXT:    s_waitcnt vmcnt(0)2385; GFX10PLUS-NEXT:    ; return to shader part epilog2386;2387; GFX12-LABEL: adjust_writemask_sample_01:2388; GFX12:       ; %bb.0: ; %main_body2389; GFX12-NEXT:    s_mov_b32 s12, exec_lo2390; GFX12-NEXT:    s_wqm_b32 exec_lo, exec_lo2391; GFX12-NEXT:    s_and_b32 exec_lo, exec_lo, s122392; GFX12-NEXT:    image_sample v[0:1], v0, s[0:7], s[8:11] dmask:0x3 dim:SQ_RSRC_IMG_1D2393; GFX12-NEXT:    s_wait_samplecnt 0x02394; GFX12-NEXT:    ; return to shader part epilog2395main_body:2396  %r = call <4 x float> @llvm.amdgcn.image.sample.1d.v4f32.f32(i32 15, float %s, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)2397  %out = shufflevector <4 x float> %r, <4 x float> poison, <2 x i32> <i32 0, i32 1>2398  ret <2 x float> %out2399}2400 2401define amdgpu_ps <3 x float> @adjust_writemask_sample_012(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %s) {2402; VERDE-LABEL: adjust_writemask_sample_012:2403; VERDE:       ; %bb.0: ; %main_body2404; VERDE-NEXT:    s_mov_b64 s[12:13], exec2405; VERDE-NEXT:    s_wqm_b64 exec, exec2406; VERDE-NEXT:    s_and_b64 exec, exec, s[12:13]2407; VERDE-NEXT:    image_sample v[0:2], v0, s[0:7], s[8:11] dmask:0x72408; VERDE-NEXT:    s_waitcnt vmcnt(0)2409; VERDE-NEXT:    ; return to shader part epilog2410;2411; GFX6789-LABEL: adjust_writemask_sample_012:2412; GFX6789:       ; %bb.0: ; %main_body2413; GFX6789-NEXT:    s_mov_b64 s[12:13], exec2414; GFX6789-NEXT:    s_wqm_b64 exec, exec2415; GFX6789-NEXT:    s_and_b64 exec, exec, s[12:13]2416; GFX6789-NEXT:    image_sample v[0:2], v0, s[0:7], s[8:11] dmask:0x72417; GFX6789-NEXT:    s_waitcnt vmcnt(0)2418; GFX6789-NEXT:    ; return to shader part epilog2419;2420; GFX10PLUS-LABEL: adjust_writemask_sample_012:2421; GFX10PLUS:       ; %bb.0: ; %main_body2422; GFX10PLUS-NEXT:    s_mov_b32 s12, exec_lo2423; GFX10PLUS-NEXT:    s_wqm_b32 exec_lo, exec_lo2424; GFX10PLUS-NEXT:    s_and_b32 exec_lo, exec_lo, s122425; GFX10PLUS-NEXT:    image_sample v[0:2], v0, s[0:7], s[8:11] dmask:0x7 dim:SQ_RSRC_IMG_1D2426; GFX10PLUS-NEXT:    s_waitcnt vmcnt(0)2427; GFX10PLUS-NEXT:    ; return to shader part epilog2428;2429; GFX12-LABEL: adjust_writemask_sample_012:2430; GFX12:       ; %bb.0: ; %main_body2431; GFX12-NEXT:    s_mov_b32 s12, exec_lo2432; GFX12-NEXT:    s_wqm_b32 exec_lo, exec_lo2433; GFX12-NEXT:    s_and_b32 exec_lo, exec_lo, s122434; GFX12-NEXT:    image_sample v[0:2], v0, s[0:7], s[8:11] dmask:0x7 dim:SQ_RSRC_IMG_1D2435; GFX12-NEXT:    s_wait_samplecnt 0x02436; GFX12-NEXT:    ; return to shader part epilog2437main_body:2438  %r = call <4 x float> @llvm.amdgcn.image.sample.1d.v4f32.f32(i32 15, float %s, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)2439  %out = shufflevector <4 x float> %r, <4 x float> poison, <3 x i32> <i32 0, i32 1, i32 2>2440  ret <3 x float> %out2441}2442 2443define amdgpu_ps <2 x float> @adjust_writemask_sample_12(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %s) {2444; VERDE-LABEL: adjust_writemask_sample_12:2445; VERDE:       ; %bb.0: ; %main_body2446; VERDE-NEXT:    s_mov_b64 s[12:13], exec2447; VERDE-NEXT:    s_wqm_b64 exec, exec2448; VERDE-NEXT:    s_and_b64 exec, exec, s[12:13]2449; VERDE-NEXT:    image_sample v[0:1], v0, s[0:7], s[8:11] dmask:0x62450; VERDE-NEXT:    s_waitcnt vmcnt(0)2451; VERDE-NEXT:    ; return to shader part epilog2452;2453; GFX6789-LABEL: adjust_writemask_sample_12:2454; GFX6789:       ; %bb.0: ; %main_body2455; GFX6789-NEXT:    s_mov_b64 s[12:13], exec2456; GFX6789-NEXT:    s_wqm_b64 exec, exec2457; GFX6789-NEXT:    s_and_b64 exec, exec, s[12:13]2458; GFX6789-NEXT:    image_sample v[0:1], v0, s[0:7], s[8:11] dmask:0x62459; GFX6789-NEXT:    s_waitcnt vmcnt(0)2460; GFX6789-NEXT:    ; return to shader part epilog2461;2462; GFX10PLUS-LABEL: adjust_writemask_sample_12:2463; GFX10PLUS:       ; %bb.0: ; %main_body2464; GFX10PLUS-NEXT:    s_mov_b32 s12, exec_lo2465; GFX10PLUS-NEXT:    s_wqm_b32 exec_lo, exec_lo2466; GFX10PLUS-NEXT:    s_and_b32 exec_lo, exec_lo, s122467; GFX10PLUS-NEXT:    image_sample v[0:1], v0, s[0:7], s[8:11] dmask:0x6 dim:SQ_RSRC_IMG_1D2468; GFX10PLUS-NEXT:    s_waitcnt vmcnt(0)2469; GFX10PLUS-NEXT:    ; return to shader part epilog2470;2471; GFX12-LABEL: adjust_writemask_sample_12:2472; GFX12:       ; %bb.0: ; %main_body2473; GFX12-NEXT:    s_mov_b32 s12, exec_lo2474; GFX12-NEXT:    s_wqm_b32 exec_lo, exec_lo2475; GFX12-NEXT:    s_and_b32 exec_lo, exec_lo, s122476; GFX12-NEXT:    image_sample v[0:1], v0, s[0:7], s[8:11] dmask:0x6 dim:SQ_RSRC_IMG_1D2477; GFX12-NEXT:    s_wait_samplecnt 0x02478; GFX12-NEXT:    ; return to shader part epilog2479main_body:2480  %r = call <4 x float> @llvm.amdgcn.image.sample.1d.v4f32.f32(i32 15, float %s, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)2481  %out = shufflevector <4 x float> %r, <4 x float> poison, <2 x i32> <i32 1, i32 2>2482  ret <2 x float> %out2483}2484 2485define amdgpu_ps <2 x float> @adjust_writemask_sample_03(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %s) {2486; VERDE-LABEL: adjust_writemask_sample_03:2487; VERDE:       ; %bb.0: ; %main_body2488; VERDE-NEXT:    s_mov_b64 s[12:13], exec2489; VERDE-NEXT:    s_wqm_b64 exec, exec2490; VERDE-NEXT:    s_and_b64 exec, exec, s[12:13]2491; VERDE-NEXT:    image_sample v[0:1], v0, s[0:7], s[8:11] dmask:0x92492; VERDE-NEXT:    s_waitcnt vmcnt(0)2493; VERDE-NEXT:    ; return to shader part epilog2494;2495; GFX6789-LABEL: adjust_writemask_sample_03:2496; GFX6789:       ; %bb.0: ; %main_body2497; GFX6789-NEXT:    s_mov_b64 s[12:13], exec2498; GFX6789-NEXT:    s_wqm_b64 exec, exec2499; GFX6789-NEXT:    s_and_b64 exec, exec, s[12:13]2500; GFX6789-NEXT:    image_sample v[0:1], v0, s[0:7], s[8:11] dmask:0x92501; GFX6789-NEXT:    s_waitcnt vmcnt(0)2502; GFX6789-NEXT:    ; return to shader part epilog2503;2504; GFX10PLUS-LABEL: adjust_writemask_sample_03:2505; GFX10PLUS:       ; %bb.0: ; %main_body2506; GFX10PLUS-NEXT:    s_mov_b32 s12, exec_lo2507; GFX10PLUS-NEXT:    s_wqm_b32 exec_lo, exec_lo2508; GFX10PLUS-NEXT:    s_and_b32 exec_lo, exec_lo, s122509; GFX10PLUS-NEXT:    image_sample v[0:1], v0, s[0:7], s[8:11] dmask:0x9 dim:SQ_RSRC_IMG_1D2510; GFX10PLUS-NEXT:    s_waitcnt vmcnt(0)2511; GFX10PLUS-NEXT:    ; return to shader part epilog2512;2513; GFX12-LABEL: adjust_writemask_sample_03:2514; GFX12:       ; %bb.0: ; %main_body2515; GFX12-NEXT:    s_mov_b32 s12, exec_lo2516; GFX12-NEXT:    s_wqm_b32 exec_lo, exec_lo2517; GFX12-NEXT:    s_and_b32 exec_lo, exec_lo, s122518; GFX12-NEXT:    image_sample v[0:1], v0, s[0:7], s[8:11] dmask:0x9 dim:SQ_RSRC_IMG_1D2519; GFX12-NEXT:    s_wait_samplecnt 0x02520; GFX12-NEXT:    ; return to shader part epilog2521main_body:2522  %r = call <4 x float> @llvm.amdgcn.image.sample.1d.v4f32.f32(i32 15, float %s, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)2523  %out = shufflevector <4 x float> %r, <4 x float> poison, <2 x i32> <i32 0, i32 3>2524  ret <2 x float> %out2525}2526 2527define amdgpu_ps <2 x float> @adjust_writemask_sample_13(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %s) {2528; VERDE-LABEL: adjust_writemask_sample_13:2529; VERDE:       ; %bb.0: ; %main_body2530; VERDE-NEXT:    s_mov_b64 s[12:13], exec2531; VERDE-NEXT:    s_wqm_b64 exec, exec2532; VERDE-NEXT:    s_and_b64 exec, exec, s[12:13]2533; VERDE-NEXT:    image_sample v[0:1], v0, s[0:7], s[8:11] dmask:0xa2534; VERDE-NEXT:    s_waitcnt vmcnt(0)2535; VERDE-NEXT:    ; return to shader part epilog2536;2537; GFX6789-LABEL: adjust_writemask_sample_13:2538; GFX6789:       ; %bb.0: ; %main_body2539; GFX6789-NEXT:    s_mov_b64 s[12:13], exec2540; GFX6789-NEXT:    s_wqm_b64 exec, exec2541; GFX6789-NEXT:    s_and_b64 exec, exec, s[12:13]2542; GFX6789-NEXT:    image_sample v[0:1], v0, s[0:7], s[8:11] dmask:0xa2543; GFX6789-NEXT:    s_waitcnt vmcnt(0)2544; GFX6789-NEXT:    ; return to shader part epilog2545;2546; GFX10PLUS-LABEL: adjust_writemask_sample_13:2547; GFX10PLUS:       ; %bb.0: ; %main_body2548; GFX10PLUS-NEXT:    s_mov_b32 s12, exec_lo2549; GFX10PLUS-NEXT:    s_wqm_b32 exec_lo, exec_lo2550; GFX10PLUS-NEXT:    s_and_b32 exec_lo, exec_lo, s122551; GFX10PLUS-NEXT:    image_sample v[0:1], v0, s[0:7], s[8:11] dmask:0xa dim:SQ_RSRC_IMG_1D2552; GFX10PLUS-NEXT:    s_waitcnt vmcnt(0)2553; GFX10PLUS-NEXT:    ; return to shader part epilog2554;2555; GFX12-LABEL: adjust_writemask_sample_13:2556; GFX12:       ; %bb.0: ; %main_body2557; GFX12-NEXT:    s_mov_b32 s12, exec_lo2558; GFX12-NEXT:    s_wqm_b32 exec_lo, exec_lo2559; GFX12-NEXT:    s_and_b32 exec_lo, exec_lo, s122560; GFX12-NEXT:    image_sample v[0:1], v0, s[0:7], s[8:11] dmask:0xa dim:SQ_RSRC_IMG_1D2561; GFX12-NEXT:    s_wait_samplecnt 0x02562; GFX12-NEXT:    ; return to shader part epilog2563main_body:2564  %r = call <4 x float> @llvm.amdgcn.image.sample.1d.v4f32.f32(i32 15, float %s, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)2565  %out = shufflevector <4 x float> %r, <4 x float> poison, <2 x i32> <i32 1, i32 3>2566  ret <2 x float> %out2567}2568 2569define amdgpu_ps <3 x float> @adjust_writemask_sample_123(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %s) {2570; VERDE-LABEL: adjust_writemask_sample_123:2571; VERDE:       ; %bb.0: ; %main_body2572; VERDE-NEXT:    s_mov_b64 s[12:13], exec2573; VERDE-NEXT:    s_wqm_b64 exec, exec2574; VERDE-NEXT:    s_and_b64 exec, exec, s[12:13]2575; VERDE-NEXT:    image_sample v[0:2], v0, s[0:7], s[8:11] dmask:0xe2576; VERDE-NEXT:    s_waitcnt vmcnt(0)2577; VERDE-NEXT:    ; return to shader part epilog2578;2579; GFX6789-LABEL: adjust_writemask_sample_123:2580; GFX6789:       ; %bb.0: ; %main_body2581; GFX6789-NEXT:    s_mov_b64 s[12:13], exec2582; GFX6789-NEXT:    s_wqm_b64 exec, exec2583; GFX6789-NEXT:    s_and_b64 exec, exec, s[12:13]2584; GFX6789-NEXT:    image_sample v[0:2], v0, s[0:7], s[8:11] dmask:0xe2585; GFX6789-NEXT:    s_waitcnt vmcnt(0)2586; GFX6789-NEXT:    ; return to shader part epilog2587;2588; GFX10PLUS-LABEL: adjust_writemask_sample_123:2589; GFX10PLUS:       ; %bb.0: ; %main_body2590; GFX10PLUS-NEXT:    s_mov_b32 s12, exec_lo2591; GFX10PLUS-NEXT:    s_wqm_b32 exec_lo, exec_lo2592; GFX10PLUS-NEXT:    s_and_b32 exec_lo, exec_lo, s122593; GFX10PLUS-NEXT:    image_sample v[0:2], v0, s[0:7], s[8:11] dmask:0xe dim:SQ_RSRC_IMG_1D2594; GFX10PLUS-NEXT:    s_waitcnt vmcnt(0)2595; GFX10PLUS-NEXT:    ; return to shader part epilog2596;2597; GFX12-LABEL: adjust_writemask_sample_123:2598; GFX12:       ; %bb.0: ; %main_body2599; GFX12-NEXT:    s_mov_b32 s12, exec_lo2600; GFX12-NEXT:    s_wqm_b32 exec_lo, exec_lo2601; GFX12-NEXT:    s_and_b32 exec_lo, exec_lo, s122602; GFX12-NEXT:    image_sample v[0:2], v0, s[0:7], s[8:11] dmask:0xe dim:SQ_RSRC_IMG_1D2603; GFX12-NEXT:    s_wait_samplecnt 0x02604; GFX12-NEXT:    ; return to shader part epilog2605main_body:2606  %r = call <4 x float> @llvm.amdgcn.image.sample.1d.v4f32.f32(i32 15, float %s, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)2607  %out = shufflevector <4 x float> %r, <4 x float> poison, <3 x i32> <i32 1, i32 2, i32 3>2608  ret <3 x float> %out2609}2610 2611define amdgpu_ps <4 x float> @adjust_writemask_sample_none_enabled(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %s) {2612; VERDE-LABEL: adjust_writemask_sample_none_enabled:2613; VERDE:       ; %bb.0: ; %main_body2614; VERDE-NEXT:    ; return to shader part epilog2615;2616; GFX6789-LABEL: adjust_writemask_sample_none_enabled:2617; GFX6789:       ; %bb.0: ; %main_body2618; GFX6789-NEXT:    ; return to shader part epilog2619;2620; GFX10PLUS-LABEL: adjust_writemask_sample_none_enabled:2621; GFX10PLUS:       ; %bb.0: ; %main_body2622; GFX10PLUS-NEXT:    ; return to shader part epilog2623;2624; GFX12-LABEL: adjust_writemask_sample_none_enabled:2625; GFX12:       ; %bb.0: ; %main_body2626; GFX12-NEXT:    ; return to shader part epilog2627main_body:2628  %r = call <4 x float> @llvm.amdgcn.image.sample.1d.v4f32.f32(i32 0, float %s, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)2629  ret <4 x float> %r2630}2631 2632define amdgpu_ps <2 x float> @adjust_writemask_sample_123_to_12(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %s) {2633; VERDE-LABEL: adjust_writemask_sample_123_to_12:2634; VERDE:       ; %bb.0: ; %main_body2635; VERDE-NEXT:    s_mov_b64 s[12:13], exec2636; VERDE-NEXT:    s_wqm_b64 exec, exec2637; VERDE-NEXT:    s_and_b64 exec, exec, s[12:13]2638; VERDE-NEXT:    image_sample v[0:1], v0, s[0:7], s[8:11] dmask:0x62639; VERDE-NEXT:    s_waitcnt vmcnt(0)2640; VERDE-NEXT:    ; return to shader part epilog2641;2642; GFX6789-LABEL: adjust_writemask_sample_123_to_12:2643; GFX6789:       ; %bb.0: ; %main_body2644; GFX6789-NEXT:    s_mov_b64 s[12:13], exec2645; GFX6789-NEXT:    s_wqm_b64 exec, exec2646; GFX6789-NEXT:    s_and_b64 exec, exec, s[12:13]2647; GFX6789-NEXT:    image_sample v[0:1], v0, s[0:7], s[8:11] dmask:0x62648; GFX6789-NEXT:    s_waitcnt vmcnt(0)2649; GFX6789-NEXT:    ; return to shader part epilog2650;2651; GFX10PLUS-LABEL: adjust_writemask_sample_123_to_12:2652; GFX10PLUS:       ; %bb.0: ; %main_body2653; GFX10PLUS-NEXT:    s_mov_b32 s12, exec_lo2654; GFX10PLUS-NEXT:    s_wqm_b32 exec_lo, exec_lo2655; GFX10PLUS-NEXT:    s_and_b32 exec_lo, exec_lo, s122656; GFX10PLUS-NEXT:    image_sample v[0:1], v0, s[0:7], s[8:11] dmask:0x6 dim:SQ_RSRC_IMG_1D2657; GFX10PLUS-NEXT:    s_waitcnt vmcnt(0)2658; GFX10PLUS-NEXT:    ; return to shader part epilog2659;2660; GFX12-LABEL: adjust_writemask_sample_123_to_12:2661; GFX12:       ; %bb.0: ; %main_body2662; GFX12-NEXT:    s_mov_b32 s12, exec_lo2663; GFX12-NEXT:    s_wqm_b32 exec_lo, exec_lo2664; GFX12-NEXT:    s_and_b32 exec_lo, exec_lo, s122665; GFX12-NEXT:    image_sample v[0:1], v0, s[0:7], s[8:11] dmask:0x6 dim:SQ_RSRC_IMG_1D2666; GFX12-NEXT:    s_wait_samplecnt 0x02667; GFX12-NEXT:    ; return to shader part epilog2668main_body:2669  %r = call <4 x float> @llvm.amdgcn.image.sample.1d.v4f32.f32(i32 14, float %s, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)2670  %out = shufflevector <4 x float> %r, <4 x float> poison, <2 x i32> <i32 0, i32 1>2671  ret <2 x float> %out2672}2673 2674define amdgpu_ps <2 x float> @adjust_writemask_sample_013_to_13(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %s) {2675; VERDE-LABEL: adjust_writemask_sample_013_to_13:2676; VERDE:       ; %bb.0: ; %main_body2677; VERDE-NEXT:    s_mov_b64 s[12:13], exec2678; VERDE-NEXT:    s_wqm_b64 exec, exec2679; VERDE-NEXT:    s_and_b64 exec, exec, s[12:13]2680; VERDE-NEXT:    image_sample v[0:1], v0, s[0:7], s[8:11] dmask:0xa2681; VERDE-NEXT:    s_waitcnt vmcnt(0)2682; VERDE-NEXT:    ; return to shader part epilog2683;2684; GFX6789-LABEL: adjust_writemask_sample_013_to_13:2685; GFX6789:       ; %bb.0: ; %main_body2686; GFX6789-NEXT:    s_mov_b64 s[12:13], exec2687; GFX6789-NEXT:    s_wqm_b64 exec, exec2688; GFX6789-NEXT:    s_and_b64 exec, exec, s[12:13]2689; GFX6789-NEXT:    image_sample v[0:1], v0, s[0:7], s[8:11] dmask:0xa2690; GFX6789-NEXT:    s_waitcnt vmcnt(0)2691; GFX6789-NEXT:    ; return to shader part epilog2692;2693; GFX10PLUS-LABEL: adjust_writemask_sample_013_to_13:2694; GFX10PLUS:       ; %bb.0: ; %main_body2695; GFX10PLUS-NEXT:    s_mov_b32 s12, exec_lo2696; GFX10PLUS-NEXT:    s_wqm_b32 exec_lo, exec_lo2697; GFX10PLUS-NEXT:    s_and_b32 exec_lo, exec_lo, s122698; GFX10PLUS-NEXT:    image_sample v[0:1], v0, s[0:7], s[8:11] dmask:0xa dim:SQ_RSRC_IMG_1D2699; GFX10PLUS-NEXT:    s_waitcnt vmcnt(0)2700; GFX10PLUS-NEXT:    ; return to shader part epilog2701;2702; GFX12-LABEL: adjust_writemask_sample_013_to_13:2703; GFX12:       ; %bb.0: ; %main_body2704; GFX12-NEXT:    s_mov_b32 s12, exec_lo2705; GFX12-NEXT:    s_wqm_b32 exec_lo, exec_lo2706; GFX12-NEXT:    s_and_b32 exec_lo, exec_lo, s122707; GFX12-NEXT:    image_sample v[0:1], v0, s[0:7], s[8:11] dmask:0xa dim:SQ_RSRC_IMG_1D2708; GFX12-NEXT:    s_wait_samplecnt 0x02709; GFX12-NEXT:    ; return to shader part epilog2710main_body:2711  %r = call <4 x float> @llvm.amdgcn.image.sample.1d.v4f32.f32(i32 11, float %s, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)2712  %out = shufflevector <4 x float> %r, <4 x float> poison, <2 x i32> <i32 1, i32 2>2713  ret <2 x float> %out2714}2715 2716declare <4 x float> @llvm.amdgcn.image.sample.1d.v4f32.f32(i32, float, <8 x i32>, <4 x i32>, i1, i32, i32) #12717declare {<4 x float>,i32} @llvm.amdgcn.image.sample.1d.v4f32i32.f32(i32, float, <8 x i32>, <4 x i32>, i1, i32, i32) #12718declare <4 x float> @llvm.amdgcn.image.sample.2d.v4f32.f32(i32, float, float, <8 x i32>, <4 x i32>, i1, i32, i32) #12719declare <4 x float> @llvm.amdgcn.image.sample.3d.v4f32.f32(i32, float, float, float, <8 x i32>, <4 x i32>, i1, i32, i32) #12720declare <4 x float> @llvm.amdgcn.image.sample.cube.v4f32.f32(i32, float, float, float, <8 x i32>, <4 x i32>, i1, i32, i32) #12721declare <4 x float> @llvm.amdgcn.image.sample.1darray.v4f32.f32(i32, float, float, <8 x i32>, <4 x i32>, i1, i32, i32) #12722declare <4 x float> @llvm.amdgcn.image.sample.2darray.v4f32.f32(i32, float, float, float, <8 x i32>, <4 x i32>, i1, i32, i32) #12723 2724declare <4 x float> @llvm.amdgcn.image.sample.c.1d.v4f32.f32(i32, float, float, <8 x i32>, <4 x i32>, i1, i32, i32) #12725declare <4 x float> @llvm.amdgcn.image.sample.c.2d.v4f32.f32(i32, float, float, float, <8 x i32>, <4 x i32>, i1, i32, i32) #12726declare <4 x float> @llvm.amdgcn.image.sample.cl.1d.v4f32.f32(i32, float, float, <8 x i32>, <4 x i32>, i1, i32, i32) #12727declare <4 x float> @llvm.amdgcn.image.sample.cl.2d.v4f32.f32(i32, float, float, float, <8 x i32>, <4 x i32>, i1, i32, i32) #12728declare <4 x float> @llvm.amdgcn.image.sample.c.cl.1d.v4f32.f32(i32, float, float, float, <8 x i32>, <4 x i32>, i1, i32, i32) #12729declare <4 x float> @llvm.amdgcn.image.sample.c.cl.2d.v4f32.f32(i32, float, float, float, float, <8 x i32>, <4 x i32>, i1, i32, i32) #12730 2731declare <4 x float> @llvm.amdgcn.image.sample.b.1d.v4f32.f32.f32(i32, float, float, <8 x i32>, <4 x i32>, i1, i32, i32) #12732declare <4 x float> @llvm.amdgcn.image.sample.b.2d.v4f32.f32.f32(i32, float, float, float, <8 x i32>, <4 x i32>, i1, i32, i32) #12733declare <4 x float> @llvm.amdgcn.image.sample.c.b.1d.v4f32.f32.f32(i32, float, float, float, <8 x i32>, <4 x i32>, i1, i32, i32) #12734declare <4 x float> @llvm.amdgcn.image.sample.c.b.2d.v4f32.f32.f32(i32, float, float, float, float, <8 x i32>, <4 x i32>, i1, i32, i32) #12735declare <4 x float> @llvm.amdgcn.image.sample.b.cl.1d.v4f32.f32.f32(i32, float, float, float, <8 x i32>, <4 x i32>, i1, i32, i32) #12736declare <4 x float> @llvm.amdgcn.image.sample.b.cl.2d.v4f32.f32.f32(i32, float, float, float, float, <8 x i32>, <4 x i32>, i1, i32, i32) #12737declare <4 x float> @llvm.amdgcn.image.sample.c.b.cl.1d.v4f32.f32.f32(i32, float, float, float, float, <8 x i32>, <4 x i32>, i1, i32, i32) #12738declare <4 x float> @llvm.amdgcn.image.sample.c.b.cl.2d.v4f32.f32.f32(i32, float, float, float, float, float, <8 x i32>, <4 x i32>, i1, i32, i32) #12739 2740declare <4 x float> @llvm.amdgcn.image.sample.d.1d.v4f32.f32.f32(i32, float, float, float, <8 x i32>, <4 x i32>, i1, i32, i32) #12741declare <4 x float> @llvm.amdgcn.image.sample.d.2d.v4f32.f32.f32(i32, float, float, float, float, float, float, <8 x i32>, <4 x i32>, i1, i32, i32) #12742declare <4 x float> @llvm.amdgcn.image.sample.c.d.1d.v4f32.f32.f32(i32, float, float, float, float, <8 x i32>, <4 x i32>, i1, i32, i32) #12743declare <4 x float> @llvm.amdgcn.image.sample.c.d.2d.v4f32.f32.f32(i32, float, float, float, float, float, float, float, <8 x i32>, <4 x i32>, i1, i32, i32) #12744declare <4 x float> @llvm.amdgcn.image.sample.d.cl.1d.v4f32.f32.f32(i32, float, float, float, float, <8 x i32>, <4 x i32>, i1, i32, i32) #12745declare <4 x float> @llvm.amdgcn.image.sample.d.cl.2d.v4f32.f32.f32(i32, float, float, float, float, float, float, float, <8 x i32>, <4 x i32>, i1, i32, i32) #12746declare <4 x float> @llvm.amdgcn.image.sample.c.d.cl.1d.v4f32.f32.f32(i32, float, float, float, float, float, <8 x i32>, <4 x i32>, i1, i32, i32) #12747declare <4 x float> @llvm.amdgcn.image.sample.c.d.cl.2d.v4f32.f32.f32(i32, float, float, float, float, float, float, float, float, <8 x i32>, <4 x i32>, i1, i32, i32) #12748 2749declare <4 x float> @llvm.amdgcn.image.sample.l.1d.v4f32.f32(i32, float, float, <8 x i32>, <4 x i32>, i1, i32, i32) #12750declare <4 x float> @llvm.amdgcn.image.sample.l.2d.v4f32.f32(i32, float, float, float, <8 x i32>, <4 x i32>, i1, i32, i32) #12751declare <4 x float> @llvm.amdgcn.image.sample.c.l.1d.v4f32.f32(i32, float, float, float, <8 x i32>, <4 x i32>, i1, i32, i32) #12752declare <4 x float> @llvm.amdgcn.image.sample.c.l.2d.v4f32.f32(i32, float, float, float, float, <8 x i32>, <4 x i32>, i1, i32, i32) #12753 2754declare <4 x float> @llvm.amdgcn.image.sample.lz.1d.v4f32.f32(i32, float, <8 x i32>, <4 x i32>, i1, i32, i32) #12755declare <4 x float> @llvm.amdgcn.image.sample.lz.2d.v4f32.f32(i32, float, float, <8 x i32>, <4 x i32>, i1, i32, i32) #12756declare <4 x float> @llvm.amdgcn.image.sample.c.lz.1d.v4f32.f32(i32, float, float, <8 x i32>, <4 x i32>, i1, i32, i32) #12757declare <4 x float> @llvm.amdgcn.image.sample.c.lz.2d.v4f32.f32(i32, float, float, float, <8 x i32>, <4 x i32>, i1, i32, i32) #12758 2759declare float @llvm.amdgcn.image.sample.c.d.o.2darray.f32.f32.f32(i32, i32, float, float, float, float, float, float, float, float, <8 x i32>, <4 x i32>, i1, i32, i32) #12760declare {float, i32} @llvm.amdgcn.image.sample.c.d.o.2darray.f32i32.f32.f32(i32, i32, float, float, float, float, float, float, float, float, <8 x i32>, <4 x i32>, i1, i32, i32) #12761declare <2 x float> @llvm.amdgcn.image.sample.c.d.o.2darray.v2f32.f32.f32(i32, i32, float, float, float, float, float, float, float, float, <8 x i32>, <4 x i32>, i1, i32, i32) #12762declare {<2 x float>, i32} @llvm.amdgcn.image.sample.c.d.o.2darray.v2f32i32.f32.f32(i32, i32, float, float, float, float, float, float, float, float, <8 x i32>, <4 x i32>, i1, i32, i32) #12763 2764attributes #0 = { nounwind }2765attributes #1 = { nounwind readonly }2766attributes #2 = { nounwind readnone }2767