llvm.org GIT mirror llvm / cba1dff
Merging r202336: ------------------------------------------------------------------------ r202336 | michel.daenzer | 2014-02-26 17:47:02 -0800 (Wed, 26 Feb 2014) | 4 lines R600/SI: Allow SI_KILL for geometry shaders Reviewed-by: Tom Stellard <thomas.stellard@amd.com> git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_34@204638 91177308-0d34-0410-b5e6-96231b3b80d8 Tom Stellard 6 years ago
2 changed file(s) with 25 addition(s) and 3 deletion(s). Raw diff Collapse all Expand all
144144 MachineBasicBlock &MBB = *MI.getParent();
145145 DebugLoc DL = MI.getDebugLoc();
146146
147 if (!shouldSkip(&MBB, &MBB.getParent()->back()))
147 if (MBB.getParent()->getInfo()->ShaderType !=
148 ShaderType::PIXEL ||
149 !shouldSkip(&MBB, &MBB.getParent()->back()))
148150 return;
149151
150152 MachineBasicBlock::iterator Insert = &MI;
295297 MachineBasicBlock &MBB = *MI.getParent();
296298 DebugLoc DL = MI.getDebugLoc();
297299
298 // Kill is only allowed in pixel shaders
300 // Kill is only allowed in pixel / geometry shaders
299301 assert(MBB.getParent()->getInfo()->ShaderType ==
300 ShaderType::PIXEL);
302 ShaderType::PIXEL ||
303 MBB.getParent()->getInfo()->ShaderType ==
304 ShaderType::GEOMETRY);
301305
302306 // Clear this pixel from the exec mask if the operand is negative
303307 BuildMI(MBB, &MI, DL, TII->get(AMDGPU::V_CMPX_LE_F32_e32), AMDGPU::VCC)
0 ; RUN: llc < %s -march=r600 -mcpu=verde -verify-machineinstrs | FileCheck --check-prefix=SI %s
1
2 ; SI-LABEL: @kill_gs
3 ; SI: V_CMPX_LE_F32
4
5 define void @kill_gs() #0 {
6 main_body:
7 %0 = icmp ule i32 0, 3
8 %1 = select i1 %0, float 1.000000e+00, float -1.000000e+00
9 call void @llvm.AMDGPU.kill(float %1)
10 ret void
11 }
12
13 declare void @llvm.AMDGPU.kill(float)
14
15 attributes #0 = { "ShaderType"="2" }
16
17 !0 = metadata !{metadata !"const", null, i32 1}