Skip to content

Commit 2b4745f

Browse files
committed
AMDGPU: Avoid relying on an undef value in test
This was really becoming a direct call during the DAG, so it wasn't as true to the test purpose.
1 parent f22c63b commit 2b4745f

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

llvm/test/CodeGen/AMDGPU/indirect-call-known-callees.ll

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,12 @@
77
; FIXME: Passing real values for workitem ID, and 0s that can be undef
88

99
; CHECK-LABEL: indirect_call_known_no_special_inputs:
10-
; CHECK: s_mov_b64 s[8:9], 0
11-
; CHECK: s_mov_b32 s12, s6
12-
; CHECK: v_mov_b32_e32 v31, v0
13-
; CHECK: s_swappc_b64
10+
11+
; CHECK-DAG: s_cselect_b64 [[CALL_TARGET:s\[[0-9]+:[0-9]+\]]]
12+
; CHECK-DAG: s_mov_b64 s[8:9], 0
13+
; CHECK-DAG: s_mov_b32 s12, s6
14+
; CHECK-DAG: v_mov_b32_e32 v31, v0
15+
; CHECK: s_swappc_b64 s[30:31], [[CALL_TARGET]]
1416

1517
; CHECK: .amdhsa_kernarg_size 0
1618
; CHECK-NEXT: .amdhsa_user_sgpr_private_segment_buffer 1
@@ -28,7 +30,8 @@
2830
; CHECK-NEXT: .amdhsa_system_vgpr_workitem_id 0
2931
define amdgpu_kernel void @indirect_call_known_no_special_inputs() {
3032
bb:
31-
%tmp = select i1 undef, void (i8*, i32, i8*)* bitcast (void ()* @wobble to void (i8*, i32, i8*)*), void (i8*, i32, i8*)* bitcast (void ()* @snork to void (i8*, i32, i8*)*)
33+
%cond = load i1, i1 addrspace(4)* null
34+
%tmp = select i1 %cond, void (i8*, i32, i8*)* bitcast (void ()* @wobble to void (i8*, i32, i8*)*), void (i8*, i32, i8*)* bitcast (void ()* @snork to void (i8*, i32, i8*)*)
3235
call void %tmp(i8* undef, i32 undef, i8* undef)
3336
ret void
3437
}

0 commit comments

Comments
 (0)