brintos

brintos / llvm-project-archived public Read only

0
0
Text · 3.1 KiB · 83e3490 Raw
69 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 52; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx942 < %s | FileCheck %s3 4; iglp.opt should not be flagged as clobbering the memory operand for the global_load, and we should be able to5; lower into the scalar version (i.e. should not need to lower into vector version with waterfall loop)6 7define amdgpu_kernel void @func(ptr addrspace(1) %in, ptr addrspace(3) %out) {8; CHECK-LABEL: func:9; CHECK:       ; %bb.0: ; %.lr.ph10; CHECK-NEXT:    s_load_dwordx2 s[6:7], s[4:5], 0x011; CHECK-NEXT:    s_mov_b64 s[8:9], 012; CHECK-NEXT:    s_mov_b32 s3, 3213; CHECK-NEXT:    s_mov_b32 s2, 014; CHECK-NEXT:    s_mov_b64 s[10:11], 015; CHECK-NEXT:    s_mov_b64 s[12:13], 016; CHECK-NEXT:  .LBB0_1: ; %loop17; CHECK-NEXT:    ; =>This Inner Loop Header: Depth=118; CHECK-NEXT:    s_mov_b64 s[0:1], s[10:11]19; CHECK-NEXT:    s_waitcnt lgkmcnt(0)20; CHECK-NEXT:    s_add_u32 s10, s6, s1221; CHECK-NEXT:    s_addc_u32 s11, s7, s1322; CHECK-NEXT:    s_load_dwordx2 s[12:13], s[8:9], 0x023; CHECK-NEXT:    s_add_i32 s3, s3, -124; CHECK-NEXT:    s_cmp_lg_u32 s3, 025; CHECK-NEXT:    ; iglp_opt mask(0x00000000)26; CHECK-NEXT:    s_cbranch_scc1 .LBB0_127; CHECK-NEXT:  ; %bb.2: ; %end28; CHECK-NEXT:    s_and_b32 s1, s1, 0xffff29; CHECK-NEXT:    s_mov_b32 s3, s230; CHECK-NEXT:    buffer_load_dwordx2 v[0:1], off, s[0:3], 031; CHECK-NEXT:    s_load_dword s0, s[4:5], 0x832; CHECK-NEXT:    s_waitcnt vmcnt(0)33; CHECK-NEXT:    v_mov_b32_e32 v1, 034; CHECK-NEXT:    s_waitcnt lgkmcnt(0)35; CHECK-NEXT:    v_mov_b32_e32 v2, s036; CHECK-NEXT:    v_and_b32_e32 v0, 0xff, v037; CHECK-NEXT:    ds_write_b64 v2, v[0:1]38; CHECK-NEXT:    s_endpgm39.lr.ph:40  br label %loop41 42loop:                                                ; preds = %1, %.lr.ph43  %addr = phi ptr addrspace(1) [ null, %.lr.ph ], [ %gep, %loop ]44  %offset = phi i64 [ 0, %.lr.ph ], [ %nextOff, %loop ]45  %inc = phi i32 [0, %.lr.ph], [ %incCond, %loop ]46  %rsrc = tail call ptr addrspace(8) @llvm.amdgcn.make.buffer.rsrc.p1(ptr addrspace(1) %addr, i16 0, i64 0, i32 0)47  %load = tail call <2 x i32> @llvm.amdgcn.raw.ptr.buffer.load.v2i32(ptr addrspace(8) %rsrc, i32 0, i32 0, i32 0)48  %load.bc = bitcast <2 x i32> %load to <8 x i8>49  %load.elem = extractelement <8 x i8> %load.bc, i64 050  tail call void @llvm.amdgcn.iglp.opt(i32 0)51  %vec = insertelement <4 x i8> zeroinitializer, i8 %load.elem, i64 052  %vec.bc = bitcast <4 x i8> %vec to <2 x half>53  %shuff = shufflevector <2 x half> %vec.bc, <2 x half> zeroinitializer, <4 x i32> <i32 0, i32 1, i32 2, i32 3>54  %gep = getelementptr i8, ptr addrspace(1) %in, i64 %offset55  %unmaskedload49 = load <1 x i64>, ptr addrspace(1) null, align 856  %nextOff = extractelement <1 x i64> %unmaskedload49, i64 057  %incCond = add i32 %inc, 158  %cond = icmp eq i32 %incCond, 3259  br i1 %cond, label %end, label %loop60 61end:62  store <4 x half> %shuff, ptr addrspace(3) %out, align 863  ret void64}65 66declare ptr addrspace(8) @llvm.amdgcn.make.buffer.rsrc.p1(ptr addrspace(1) readnone, i16, i64, i32) #067 68declare <2 x i32> @llvm.amdgcn.raw.ptr.buffer.load.v2i32(ptr addrspace(8) nocapture readonly, i32, i32, i32 immarg) #169