brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.8 KiB · 9896e5f Raw
46 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py2; RUN: llc -mtriple=amdgcn -o - %s | FileCheck -check-prefix=GCN %s3 4declare i32 @llvm.cttz.i32(i32, i1) nounwind readnone5declare i32 @llvm.amdgcn.sffbh.i32(i32) nounwind readnone speculatable6define amdgpu_kernel void @select_constant_cttz(ptr addrspace(1) noalias %out, ptr addrspace(1) nocapture readonly %arrayidx) nounwind {7; GCN-LABEL: select_constant_cttz:8; GCN:       ; %bb.0:9; GCN-NEXT:    s_load_dwordx4 s[0:3], s[4:5], 0x910; GCN-NEXT:    s_waitcnt lgkmcnt(0)11; GCN-NEXT:    s_load_dword s2, s[2:3], 0x012; GCN-NEXT:    s_mov_b32 s3, 0xf00013; GCN-NEXT:    s_waitcnt lgkmcnt(0)14; GCN-NEXT:    s_lshr_b32 s4, 1, s215; GCN-NEXT:    s_cmp_lg_u32 s2, 016; GCN-NEXT:    s_ff1_i32_b32 s2, s417; GCN-NEXT:    s_cselect_b64 s[4:5], -1, 018; GCN-NEXT:    s_and_b64 s[6:7], s[4:5], exec19; GCN-NEXT:    s_cselect_b32 s2, -1, s220; GCN-NEXT:    s_flbit_i32 s6, s221; GCN-NEXT:    s_sub_i32 s8, 31, s622; GCN-NEXT:    s_cmp_eq_u32 s2, 023; GCN-NEXT:    s_cselect_b64 s[6:7], -1, 024; GCN-NEXT:    s_or_b64 s[4:5], s[4:5], s[6:7]25; GCN-NEXT:    s_and_b64 s[4:5], s[4:5], exec26; GCN-NEXT:    s_cselect_b32 s4, -1, s827; GCN-NEXT:    s_mov_b32 s2, -128; GCN-NEXT:    v_mov_b32_e32 v0, s429; GCN-NEXT:    buffer_store_dword v0, off, s[0:3], 030; GCN-NEXT:    s_endpgm31  %v    = load i32, ptr addrspace(1) %arrayidx, align 432  %sr   = lshr i32 1, %v33  %cmp  = icmp ne i32 %v, 034  %cttz = call i32 @llvm.cttz.i32(i32 %sr, i1 true), !range !035  %sel  = select i1 %cmp, i32 -1, i32 %cttz36  %ffbh = call i32 @llvm.amdgcn.sffbh.i32(i32 %sel)37  %sub  = sub i32 31, %ffbh38  %cmp2 = icmp eq i32 %sel, 039  %or   = or i1 %cmp, %cmp240  %sel2 = select i1 %or, i32 -1, i32 %sub41  store i32 %sel2, ptr addrspace(1) %out42  ret void43}44 45!0 = !{i32 0, i32 33}46