Skip to content

Commit 9c8a6cd

Browse files
Konstantina MitropoulouKonstantina Mitropoulou
authored andcommitted
Add a new test with SI_KILL_F32_COND_IMM_PSEUDO
1 parent a20f999 commit 9c8a6cd

File tree

1 file changed

+55
-0
lines changed

1 file changed

+55
-0
lines changed
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
; NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py UTC_ARGS: --version 5
2+
; RUN: llc -mtriple=amdgcn -mcpu=gfx1200 -verify-machineinstrs -stop-after=amdgpu-isel < %s 2>&1 | FileCheck %s
3+
4+
target datalayout = "e-p:64:64-p1:64:64-p2:32:32-p3:32:32-p4:64:64-p5:32:32-p6:32:32-p7:160:256:256:32-p8:128:128-p9:192:256:256:32-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-v2048:2048-n32:64-S32-A5-G1-ni:7:8:9"
5+
target triple = "amdgcn--amdpal"
6+
7+
define amdgpu_ps void @_amdgpu_ps_main() {
8+
; CHECK-LABEL: name: _amdgpu_ps_main
9+
; CHECK: bb.0..entry:
10+
; CHECK-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
11+
; CHECK-NEXT: {{ $}}
12+
; CHECK-NEXT: [[S_MOV_B32_:%[0-9]+]]:sreg_32 = S_MOV_B32 0
13+
; CHECK-NEXT: [[REG_SEQUENCE:%[0-9]+]]:sgpr_128 = REG_SEQUENCE [[S_MOV_B32_]], %subreg.sub0, [[S_MOV_B32_]], %subreg.sub1, [[S_MOV_B32_]], %subreg.sub2, [[S_MOV_B32_]], %subreg.sub3
14+
; CHECK-NEXT: [[S_BUFFER_LOAD_DWORD_IMM:%[0-9]+]]:sreg_32_xm0_xexec = S_BUFFER_LOAD_DWORD_IMM killed [[REG_SEQUENCE]], 0, 0 :: (dereferenceable invariant load (s32))
15+
; CHECK-NEXT: [[S_MOV_B32_1:%[0-9]+]]:sgpr_32 = S_MOV_B32 0
16+
; CHECK-NEXT: nofpexcept S_CMP_LT_F32 [[S_BUFFER_LOAD_DWORD_IMM]], killed [[S_MOV_B32_1]], implicit-def $scc, implicit $mode
17+
; CHECK-NEXT: SI_KILL_F32_COND_IMM_PSEUDO [[S_BUFFER_LOAD_DWORD_IMM]], 0, 11, implicit-def dead $vcc, implicit $exec
18+
; CHECK-NEXT: S_CBRANCH_SCC1 %bb.2, implicit $scc
19+
; CHECK-NEXT: S_BRANCH %bb.1
20+
; CHECK-NEXT: {{ $}}
21+
; CHECK-NEXT: bb.1 (%ir-block.3):
22+
; CHECK-NEXT: successors: %bb.2(0x80000000)
23+
; CHECK-NEXT: {{ $}}
24+
; CHECK-NEXT: bb.2 (%ir-block.5):
25+
; CHECK-NEXT: S_ENDPGM 0
26+
.entry:
27+
%0 = call i32 @llvm.amdgcn.s.buffer.load.i32(<4 x i32> zeroinitializer, i32 0, i32 0)
28+
%1 = bitcast i32 %0 to float
29+
%2 = fcmp uge float %1, 0.000000e+00
30+
call void @llvm.amdgcn.kill(i1 %2)
31+
br i1 %2, label %3, label %8
32+
33+
3: ; preds = %.entry
34+
%4 = call i64 @llvm.amdgcn.s.getpc()
35+
%5 = and i64 %4, 1
36+
%6 = inttoptr i64 %5 to ptr addrspace(4)
37+
%7 = getelementptr i8, ptr addrspace(4) %6, i64 32
38+
br label %8
39+
40+
8: ; preds = %3, %.entry
41+
ret void
42+
}
43+
44+
; Function Attrs: nocallback nofree nounwind
45+
declare void @llvm.amdgcn.kill(i1) #0
46+
47+
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
48+
declare noundef i64 @llvm.amdgcn.s.getpc() #1
49+
50+
; Function Attrs: nocallback nofree nosync nounwind willreturn memory(none)
51+
declare i32 @llvm.amdgcn.s.buffer.load.i32(<4 x i32>, i32, i32 immarg) #2
52+
53+
attributes #0 = { nocallback nofree nounwind }
54+
attributes #1 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
55+
attributes #2 = { nocallback nofree nosync nounwind willreturn memory(none) }

0 commit comments

Comments
 (0)