llvm.org GIT mirror llvm / 28fe7a0
Merging r268259: ------------------------------------------------------------------------ r268259 | nhaehnle | 2016-05-02 10:37:01 -0700 (Mon, 02 May 2016) | 14 lines AMDGPU: llvm.SI.fs.constant is a source of divergence Summary: This intrinsic is used to get flat-shaded fragment shader inputs. Those are uniform across a primitive, but a fragment shader wave may process pixels from multiple primitives (as indicated by the prim_mask), and so that's where divergence can arise. Reviewers: arsenm, tstellarAMD Subscribers: arsenm, llvm-commits Differential Revision: http://reviews.llvm.org/D19747 ------------------------------------------------------------------------ git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_38@271769 91177308-0d34-0410-b5e6-96231b3b80d8 Tom Stellard 3 years ago
2 changed file(s) with 24 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
130130 return false;
131131 case AMDGPUIntrinsic::SI_tid:
132132 case AMDGPUIntrinsic::SI_fs_interp:
133 case AMDGPUIntrinsic::SI_fs_constant:
133134 return true;
134135 }
135136 }
0 ; RUN: opt -mtriple amdgcn--- -analyze -divergence %s | FileCheck %s
1
2 ; CHECK-LABEL: 'fs_interp'
3 ; CHECK: DIVERGENT: %v = call float @llvm.SI.fs.interp(
4 define void @fs_interp(i32 inreg %prim_mask, <2 x i32> %interp_param) #1 {
5 %v = call float @llvm.SI.fs.interp(i32 0, i32 0, i32 %prim_mask, <2 x i32> %interp_param)
6 store volatile float %v, float addrspace(1)* undef
7 ret void
8 }
9
10 ; CHECK-LABEL: 'fs_constant'
11 ; CHECK: DIVERGENT: %v = call float @llvm.SI.fs.constant(
12 define void @fs_constant(i32 inreg %prim_mask, <2 x i32> %interp_param) #1 {
13 %v = call float @llvm.SI.fs.constant(i32 0, i32 0, i32 %prim_mask)
14 store volatile float %v, float addrspace(1)* undef
15 ret void
16 }
17
18 declare float @llvm.SI.fs.interp(i32, i32, i32, <2 x i32>) #0
19 declare float @llvm.SI.fs.constant(i32, i32, i32) #0
20
21 attributes #0 = { nounwind readnone }
22 attributes #1 = { "ShaderType"="1"}