1; RUN: llc -mtriple=amdgcn--amdhsa -verify-machineinstrs < %s | FileCheck -check-prefix=GCN %s
2
3declare i32 @llvm.amdgcn.workitem.id.x() #0
4; GCN-LABEL: {{^}}convergent_inlineasm:
5; GCN: BB#0:
6; GCN: v_cmp_ne_i32_e64
7; GCN: BB#1:
8define void @convergent_inlineasm(i64 addrspace(1)* nocapture %arg) {
9bb:
10  %tmp = call i32 @llvm.amdgcn.workitem.id.x()
11  %tmp1 = tail call i64 asm "v_cmp_ne_i32_e64 $0, 0, $1", "=s,v"(i32 1) #1
12  %tmp2 = icmp eq i32 %tmp, 8
13  br i1 %tmp2, label %bb3, label %bb5
14
15bb3:                                              ; preds = %bb
16  %tmp4 = getelementptr i64, i64 addrspace(1)* %arg, i32 %tmp
17  store i64 %tmp1, i64 addrspace(1)* %arg, align 8
18  br label %bb5
19
20bb5:                                              ; preds = %bb3, %bb
21  ret void
22}
23
24; GCN-LABEL: {{^}}nonconvergent_inlineasm:
25; GCN: BB#1:
26; GCN: v_cmp_ne_i32_e64
27; GCN: BB1_2:
28define void @nonconvergent_inlineasm(i64 addrspace(1)* nocapture %arg) {
29bb:
30  %tmp = call i32 @llvm.amdgcn.workitem.id.x()
31  %tmp1 = tail call i64 asm "v_cmp_ne_i32_e64 $0, 0, $1", "=s,v"(i32 1)
32  %tmp2 = icmp eq i32 %tmp, 8
33  br i1 %tmp2, label %bb3, label %bb5
34
35bb3:                                              ; preds = %bb
36  %tmp4 = getelementptr i64, i64 addrspace(1)* %arg, i32 %tmp
37  store i64 %tmp1, i64 addrspace(1)* %arg, align 8
38  br label %bb5
39
40bb5:                                              ; preds = %bb3, %bb
41  ret void
42}
43
44attributes #0 = { nounwind readnone }
45attributes #1 = { convergent nounwind readnone }
46