1 ; RUN: opt %s -passes='print<uniformity>' -disable-output 2>&1 | FileCheck %s
3 target datalayout = "e-i64:64-v16:16-v32:32-n16:32:64"
4 target triple = "nvptx64-nvidia-cuda"
6 define i32 @hidden_diverge(i32 %n, i32 %a, i32 %b) {
7 ; CHECK-LABEL: for function 'hidden_diverge'
9 %tid = call i32 @llvm.nvvm.read.ptx.sreg.tid.x()
10 %cond.var = icmp slt i32 %tid, 0
11 br i1 %cond.var, label %B, label %C ; divergent
12 ; CHECK: DIVERGENT: %cond.var =
13 ; CHECK: DIVERGENT: br i1 %cond.var,
15 %cond.uni = icmp slt i32 %n, 0
16 br i1 %cond.uni, label %C, label %merge ; uniform
17 ; CHECK-NOT: DIVERGENT: %cond.uni =
18 ; CHECK-NOT: DIVERGENT: br i1 %cond.uni,
20 %phi.var.hidden = phi i32 [ 1, %entry ], [ 2, %B ]
21 ; CHECK: DIVERGENT: %phi.var.hidden = phi i32
24 %phi.ipd = phi i32 [ %a, %B ], [ %b, %C ]
25 ; CHECK: DIVERGENT: %phi.ipd = phi i32
29 declare i32 @llvm.nvvm.read.ptx.sreg.tid.x()
31 !nvvm.annotations = !{!0}
32 !0 = !{ptr @hidden_diverge, !"kernel", i32 1}