128 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py2; RUN: llc -global-isel=0 -mtriple=amdgcn-amd-amdhsa -mcpu=gfx950 < %s | FileCheck -check-prefix=GCN %s3; RUN: llc -global-isel=1 -mtriple=amdgcn-amd-amdhsa -mcpu=gfx950 < %s | FileCheck -check-prefix=GCN %s4 5; RUN: not --crash llc -global-isel=0 -mtriple=amdgcn-amd-amdhsa -mcpu=gfx942 -filetype=null %s 2>&1 | FileCheck -check-prefix=ERR-SDAG %s6; RUN: not llc -global-isel=1 -mtriple=amdgcn-amd-amdhsa -mcpu=gfx942 -filetype=null %s 2>&1 | FileCheck -check-prefix=ERR-GISEL %s7 8; ERR-SDAG: LLVM ERROR: Cannot select: intrinsic %llvm.amdgcn.permlane32.swap9; ERR-GISEL: LLVM ERROR: cannot select: %{{[0-9]+}}:vgpr_32(s32), %{{[0-9]+}}:vgpr_32(s32) = G_INTRINSIC_CONVERGENT intrinsic(@llvm.amdgcn.permlane32.swap)10 11 12declare { i32, i32 } @llvm.amdgcn.permlane32.swap(i32, i32, i1 immarg, i1 immarg)13 14define { i32, i32 } @v_permlane32_swap_b32_vv(i32 %vdst_old, i32 %src0_old) {15; GCN-LABEL: v_permlane32_swap_b32_vv:16; GCN: ; %bb.0:17; GCN-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)18; GCN-NEXT: v_permlane32_swap_b32_e32 v0, v119; GCN-NEXT: s_setpc_b64 s[30:31]20 %v = call { i32, i32 } @llvm.amdgcn.permlane32.swap(i32 %vdst_old, i32 %src0_old, i1 false, i1 false)21 ret { i32, i32 } %v22}23 24define { i32, i32 } @v_permlane32_swap_b32_vi(i32 %vdst_old) {25; GCN-LABEL: v_permlane32_swap_b32_vi:26; GCN: ; %bb.0:27; GCN-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)28; GCN-NEXT: v_mov_b32_e32 v1, 129; GCN-NEXT: s_nop 130; GCN-NEXT: v_permlane32_swap_b32_e32 v0, v131; GCN-NEXT: s_setpc_b64 s[30:31]32 %v = call { i32, i32 } @llvm.amdgcn.permlane32.swap(i32 %vdst_old, i32 1, i1 false, i1 false)33 ret { i32, i32 } %v34}35 36define { i32, i32 } @v_permlane32_swap_b32_vl(i32 %vdst_old) {37; GCN-LABEL: v_permlane32_swap_b32_vl:38; GCN: ; %bb.0:39; GCN-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)40; GCN-NEXT: v_mov_b32_e32 v1, 0xc1d141; GCN-NEXT: s_nop 142; GCN-NEXT: v_permlane32_swap_b32_e32 v0, v143; GCN-NEXT: s_setpc_b64 s[30:31]44 %v = call { i32, i32 } @llvm.amdgcn.permlane32.swap(i32 %vdst_old, i32 49617, i1 false, i1 false)45 ret { i32, i32 } %v46}47 48define { i32, i32 } @v_permlane32_swap_b32_iv(i32 %src0_old) {49; GCN-LABEL: v_permlane32_swap_b32_iv:50; GCN: ; %bb.0:51; GCN-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)52; GCN-NEXT: v_mov_b32_e32 v1, v053; GCN-NEXT: v_mov_b32_e32 v0, 154; GCN-NEXT: s_nop 155; GCN-NEXT: v_permlane32_swap_b32_e32 v0, v156; GCN-NEXT: s_setpc_b64 s[30:31]57 %v = call { i32, i32 } @llvm.amdgcn.permlane32.swap(i32 1, i32 %src0_old, i1 false, i1 false)58 ret { i32, i32 } %v59}60 61define { i32, i32 } @v_permlane32_swap_b32_ss(i32 inreg %vdst_old, i32 inreg %src0_old) {62; GCN-LABEL: v_permlane32_swap_b32_ss:63; GCN: ; %bb.0:64; GCN-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)65; GCN-NEXT: v_mov_b32_e32 v0, s066; GCN-NEXT: v_mov_b32_e32 v1, s167; GCN-NEXT: s_nop 168; GCN-NEXT: v_permlane32_swap_b32_e32 v0, v169; GCN-NEXT: s_setpc_b64 s[30:31]70 %v = call { i32, i32 } @llvm.amdgcn.permlane32.swap(i32 %vdst_old, i32 %src0_old, i1 false, i1 false)71 ret { i32, i32 } %v72}73 74define { i32, i32 } @v_permlane32_swap_b32_sv(i32 inreg %vdst_old, i32 %src0_old) {75; GCN-LABEL: v_permlane32_swap_b32_sv:76; GCN: ; %bb.0:77; GCN-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)78; GCN-NEXT: v_mov_b32_e32 v1, v079; GCN-NEXT: v_mov_b32_e32 v0, s080; GCN-NEXT: s_nop 181; GCN-NEXT: v_permlane32_swap_b32_e32 v0, v182; GCN-NEXT: s_setpc_b64 s[30:31]83 %v = call { i32, i32 } @llvm.amdgcn.permlane32.swap(i32 %vdst_old, i32 %src0_old, i1 false, i1 false)84 ret { i32, i32 } %v85}86 87define { i32, i32 } @v_permlane32_swap_b32_vs(i32 %vdst_old, i32 inreg %src0_old) {88; GCN-LABEL: v_permlane32_swap_b32_vs:89; GCN: ; %bb.0:90; GCN-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)91; GCN-NEXT: v_mov_b32_e32 v1, s092; GCN-NEXT: s_nop 193; GCN-NEXT: v_permlane32_swap_b32_e32 v0, v194; GCN-NEXT: s_setpc_b64 s[30:31]95 %v = call { i32, i32 } @llvm.amdgcn.permlane32.swap(i32 %vdst_old, i32 %src0_old, i1 false, i1 false)96 ret { i32, i32 } %v97}98 99define { i32, i32 } @v_permlane32_swap_b32_vv_fi(i32 %vdst_old, i32 %src0_old) {100; GCN-LABEL: v_permlane32_swap_b32_vv_fi:101; GCN: ; %bb.0:102; GCN-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)103; GCN-NEXT: v_permlane32_swap_b32_e64 v0, v1 fi:1104; GCN-NEXT: s_setpc_b64 s[30:31]105 %v = call { i32, i32 } @llvm.amdgcn.permlane32.swap(i32 %vdst_old, i32 %src0_old, i1 true, i1 false)106 ret { i32, i32 } %v107}108 109define { i32, i32 } @v_permlane32_swap_b32_vv_bc(i32 %vdst_old, i32 %src0_old) {110; GCN-LABEL: v_permlane32_swap_b32_vv_bc:111; GCN: ; %bb.0:112; GCN-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)113; GCN-NEXT: v_permlane32_swap_b32_e64 v0, v1 bound_ctrl:1114; GCN-NEXT: s_setpc_b64 s[30:31]115 %v = call { i32, i32 } @llvm.amdgcn.permlane32.swap(i32 %vdst_old, i32 %src0_old, i1 false, i1 true)116 ret { i32, i32 } %v117}118 119define { i32, i32 } @v_permlane32_swap_b32_vv_fi_bc(i32 %vdst_old, i32 %src0_old) {120; GCN-LABEL: v_permlane32_swap_b32_vv_fi_bc:121; GCN: ; %bb.0:122; GCN-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)123; GCN-NEXT: v_permlane32_swap_b32_e64 v0, v1 bound_ctrl:1 fi:1124; GCN-NEXT: s_setpc_b64 s[30:31]125 %v = call { i32, i32 } @llvm.amdgcn.permlane32.swap(i32 %vdst_old, i32 %src0_old, i1 true, i1 true)126 ret { i32, i32 } %v127}128