1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 18:54:02 +01:00
llvm-mirror/test/CodeGen/AMDGPU/promote-alloca-addrspacecast.ll
Matt Arsenault bf9d9a1180 AMDGPU: Switch backend default max workgroup size to 1024
Previously this would default to 256, not the maximum supported size
of 1024. Using a maximum lower than the hardware maximum requires
language runtimes to enforce this limit for correctness, which no
language has correctly done. Switch the default to the conservatively
correct maximum, and force frontends to opt-in to the more optimal 256
default maximum.

I don't really understand why the changes in occupancy-levels.ll
increased the computed occupancy, which I expected to decrease. I'm
not sure if these tests should be forcing the old maximum.
2019-11-13 07:11:02 +05:30

22 lines
1.0 KiB
LLVM

; RUN: opt -S -mtriple=amdgcn-unknown-amdhsa -mcpu=kaveri -amdgpu-promote-alloca < %s | FileCheck %s
; The types of the users of the addrspacecast should not be changed.
; CHECK-LABEL: @invalid_bitcast_addrspace(
; CHECK: getelementptr inbounds [256 x [1 x i32]], [256 x [1 x i32]] addrspace(3)* @invalid_bitcast_addrspace.data, i32 0, i32 %14
; CHECK: bitcast [1 x i32] addrspace(3)* %{{[0-9]+}} to half addrspace(3)*
; CHECK: addrspacecast half addrspace(3)* %tmp to half addrspace(4)*
; CHECK: bitcast half addrspace(4)* %tmp1 to <2 x i16> addrspace(4)*
define amdgpu_kernel void @invalid_bitcast_addrspace() #0 {
entry:
%data = alloca [1 x i32], align 4
%tmp = bitcast [1 x i32]* %data to half*
%tmp1 = addrspacecast half* %tmp to half addrspace(4)*
%tmp2 = bitcast half addrspace(4)* %tmp1 to <2 x i16> addrspace(4)*
%tmp3 = load <2 x i16>, <2 x i16> addrspace(4)* %tmp2, align 2
%tmp4 = bitcast <2 x i16> %tmp3 to <2 x half>
ret void
}
attributes #0 = { nounwind "amdgpu-flat-work-group-size"="1,256" }