[llvm-objdump] - Remove one overload of reportError. NFCI.
[llvm-complete.git] / test / CodeGen / AMDGPU / GlobalISel / irtranslator-amdgpu_vs.ll
blob5f90340fbd602c7a7af2619aef81a2d79c91ac02
1 ; RUN: llc -mtriple=amdgcn-mesa-mesa3d -mcpu=fiji -stop-after=irtranslator -global-isel %s -o - | FileCheck %s
4 ; CHECK-LABEL: name: test_f32_inreg
5 ; CHECK: [[S0:%[0-9]+]]:_(s32) = COPY $sgpr2
6 ; CHECK: G_INTRINSIC_W_SIDE_EFFECTS intrinsic(@llvm.amdgcn.exp), %{{[0-9]+}}(s32), %{{[0-9]+}}(s32), [[S0]]
7 define amdgpu_vs void @test_f32_inreg(float inreg %arg0) {
8   call void @llvm.amdgcn.exp.f32(i32 32, i32 15, float %arg0, float undef, float undef, float undef, i1 false, i1 false) #0
9   ret void
12 ; CHECK-LABEL: name: test_f32
13 ; CHECK: [[V0:%[0-9]+]]:_(s32) = COPY $vgpr0
14 ; CHECK: G_INTRINSIC_W_SIDE_EFFECTS intrinsic(@llvm.amdgcn.exp), %{{[0-9]+}}(s32), %{{[0-9]+}}(s32), [[V0]]
15 define amdgpu_vs void @test_f32(float %arg0) {
16   call void @llvm.amdgcn.exp.f32(i32 32, i32 15, float %arg0, float undef, float undef, float undef, i1 false, i1 false) #0
17   ret void
20 ; CHECK-LABEL: name: test_ptr2_inreg
21 ; CHECK: [[S2:%[0-9]+]]:_(s32) = COPY $sgpr2
22 ; CHECK: [[S3:%[0-9]+]]:_(s32) = COPY $sgpr3
23 ; CHECK: [[PTR:%[0-9]+]]:_(p4) = G_MERGE_VALUES [[S2]](s32), [[S3]](s32)
24 ; CHECK: G_LOAD [[PTR]]
25 define amdgpu_vs void @test_ptr2_inreg(i32 addrspace(4)* inreg %arg0) {
26   %tmp0 = load volatile i32, i32 addrspace(4)* %arg0
27   ret void
30 ; CHECK-LABEL: name: test_sgpr_alignment0
31 ; CHECK: [[S2:%[0-9]+]]:_(s32) = COPY $sgpr2
32 ; CHECK: [[S3:%[0-9]+]]:_(s32) = COPY $sgpr3
33 ; CHECK: [[S4:%[0-9]+]]:_(s32) = COPY $sgpr4
34 ; CHECK: [[S34:%[0-9]+]]:_(p4) = G_MERGE_VALUES [[S3]](s32), [[S4]](s32)
35 ; CHECK: G_LOAD [[S34]]
36 ; CHECK: G_INTRINSIC_W_SIDE_EFFECTS intrinsic(@llvm.amdgcn.exp), %{{[0-9]+}}(s32), %{{[0-9]+}}(s32), [[S2]]
37 define amdgpu_vs void @test_sgpr_alignment0(float inreg %arg0, i32 addrspace(4)* inreg %arg1) {
38   %tmp0 = load volatile i32, i32 addrspace(4)* %arg1
39   call void @llvm.amdgcn.exp.f32(i32 32, i32 15, float %arg0, float undef, float undef, float undef, i1 false, i1 false) #0
40   ret void
43 ; CHECK-LABEL: name: test_order
44 ; CHECK: [[S0:%[0-9]+]]:_(s32) = COPY $sgpr2
45 ; CHECK: [[S1:%[0-9]+]]:_(s32) = COPY $sgpr3
46 ; CHECK: [[V0:%[0-9]+]]:_(s32) = COPY $vgpr0
47 ; CHECK: [[V1:%[0-9]+]]:_(s32) = COPY $vgpr1
48 ; CHECK: G_INTRINSIC_W_SIDE_EFFECTS intrinsic(@llvm.amdgcn.exp), %{{[0-9]+}}(s32), %{{[0-9]+}}(s32), [[V0]](s32), [[S0]](s32), [[V1]](s32), [[S1]](s32)
49 define amdgpu_vs void @test_order(float inreg %arg0, float inreg %arg1, float %arg2, float %arg3) {
50   call void @llvm.amdgcn.exp.f32(i32 32, i32 15, float %arg2, float %arg0, float %arg3, float %arg1, i1 false, i1 false) #0
51   ret void
54 ; CHECK-LABEL: name: ret_struct
55 ; CHECK: [[S0:%[0-9]+]]:_(s32) = COPY $sgpr2
56 ; CHECK: [[S1:%[0-9]+]]:_(s32) = COPY $sgpr3
57 ; CHECK: $sgpr0 = COPY [[S0]]
58 ; CHECK: $sgpr1 = COPY [[S1]]
59 ; CHECK: SI_RETURN_TO_EPILOG implicit $sgpr0, implicit $sgpr1
60 define amdgpu_vs <{ i32, i32 }> @ret_struct(i32 inreg %arg0, i32 inreg %arg1) {
61 main_body:
62   %tmp0 = insertvalue <{ i32, i32 }> undef, i32 %arg0, 0
63   %tmp1 = insertvalue <{ i32, i32 }> %tmp0, i32 %arg1, 1
64   ret <{ i32, i32 }> %tmp1
67 ; CHECK_LABEL: name: non_void_ret
68 ; CHECK: [[ZERO:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
69 ; CHECK: $sgpr0 = COPY [[ZERO]]
70 ; SI_RETURN_TO_EPILOG $sgpr0
71 define amdgpu_vs i32 @non_void_ret() {
72   ret i32 0
75 declare void @llvm.amdgcn.exp.f32(i32, i32, float, float, float, float, i1, i1)  #0
77 attributes #0 = { nounwind }