• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: llc < %s -mtriple=amdgcn--amdpal -mcpu=tonga -verify-machineinstrs | FileCheck -check-prefixes=GCN,VI,PREGFX9 %s
2; RUN: llc < %s -mtriple=amdgcn--amdpal -mcpu=gfx810 -verify-machineinstrs | FileCheck -check-prefixes=GCN,GFX81,PREGFX9 %s
3; RUN: llc < %s -mtriple=amdgcn--amdpal -mcpu=gfx900 -verify-machineinstrs | FileCheck -check-prefixes=GCN,GFX9 %s
4
5; A test case that originally failed in divergence calculation
6; Implementation has to identify all formal args that can be a source of divergence
7
8@0 = external dso_local addrspace(4) constant [6 x <2 x float>]
9
10; GCN-LABEL: {{^}}_amdgpu_vs_main:
11; GCN-NOT: v_readfirstlane
12; PRE-GFX9: flat_load_dword
13; GFX9: global_load
14define dllexport amdgpu_vs void @_amdgpu_vs_main(i32 inreg %arg, i32 inreg %arg1, i32 inreg %arg2, i32 inreg %arg3, i32 inreg %arg4, i32 %arg5, i32 %arg6, i32 %arg7, i32 %arg8) local_unnamed_addr #0 {
15.entry:
16  %tmp = add i32 %arg4, %arg8
17  %tmp9 = sext i32 %tmp to i64
18  %tmp10 = getelementptr [6 x <2 x float>], [6 x <2 x float>] addrspace(4)* @0, i64 0, i64 %tmp9
19  %tmp11 = load <2 x float>, <2 x float> addrspace(4)* %tmp10, align 8
20  %tmp12 = fadd nnan arcp contract <2 x float> zeroinitializer, %tmp11
21  %tmp13 = extractelement <2 x float> %tmp12, i32 1
22  call void @llvm.amdgcn.exp.f32(i32 12, i32 15, float undef, float %tmp13, float 0.000000e+00, float 1.000000e+00, i1 true, i1 false) #1
23  ret void
24}
25
26declare i64 @llvm.amdgcn.s.getpc() #0
27declare void @llvm.amdgcn.exp.f32(i32, i32, float, float, float, float, i1, i1) #1
28
29attributes #0 = { nounwind readnone speculatable }
30attributes #1 = { nounwind }
31