58 lines · plain
1; RUN: llc -mtriple=amdgcn -mcpu=fiji < %s | FileCheck -check-prefixes=GCN,W64 %s2; RUN: llc -mtriple=amdgcn -mcpu=gfx1010 -mattr=+wavefrontsize32 < %s | FileCheck -check-prefixes=GCN,W32 %s3; RUN: llc -mtriple=amdgcn -mcpu=gfx1010 -mattr=+wavefrontsize64 < %s | FileCheck -check-prefixes=GCN,W64 %s4; RUN: llc -mtriple=amdgcn -mcpu=gfx1100 -mattr=+wavefrontsize32 -amdgpu-enable-vopd=0 < %s | FileCheck -check-prefixes=GCN,W32 %s5; RUN: llc -mtriple=amdgcn -mcpu=gfx1100 -mattr=+wavefrontsize64 < %s | FileCheck -check-prefixes=GCN,W64 %s6 7; GCN-LABEL: {{^}}fold_wavefrontsize:8 9; W32: v_mov_b32_e32 [[V:v[0-9]+]], 3210; W64: v_mov_b32_e32 [[V:v[0-9]+]], 6411; GCN: store_{{dword|b32}} v{{.+}}, [[V]]12 13 14define amdgpu_kernel void @fold_wavefrontsize(ptr addrspace(1) nocapture %arg) {15 16bb:17 %tmp = tail call i32 @llvm.amdgcn.wavefrontsize() #018 store i32 %tmp, ptr addrspace(1) %arg, align 419 ret void20}21 22; GCN-LABEL: {{^}}fold_and_optimize_wavefrontsize:23 24; W32: v_mov_b32_e32 [[V:v[0-9]+]], 1{{$}}25; W64: v_mov_b32_e32 [[V:v[0-9]+]], 2{{$}}26; GCN-NOT: cndmask27; GCN: store_{{dword|b32}} v{{.+}}, [[V]]28 29 30define amdgpu_kernel void @fold_and_optimize_wavefrontsize(ptr addrspace(1) nocapture %arg) {31bb:32 %tmp = tail call i32 @llvm.amdgcn.wavefrontsize() #033 %tmp1 = icmp ugt i32 %tmp, 3234 %tmp2 = select i1 %tmp1, i32 2, i32 135 store i32 %tmp2, ptr addrspace(1) %arg36 ret void37}38 39; GCN-LABEL: {{^}}fold_and_optimize_if_wavefrontsize:40 41define amdgpu_kernel void @fold_and_optimize_if_wavefrontsize(ptr addrspace(1) nocapture %arg) {42bb:43 %tmp = tail call i32 @llvm.amdgcn.wavefrontsize() #044 %tmp1 = icmp ugt i32 %tmp, 3245 br i1 %tmp1, label %bb2, label %bb346 47bb2: ; preds = %bb48 store i32 1, ptr addrspace(1) %arg, align 449 br label %bb350 51bb3: ; preds = %bb2, %bb52 ret void53}54 55declare i32 @llvm.amdgcn.wavefrontsize() #056 57attributes #0 = { nounwind readnone speculatable }58