1 ; RUN: opt -mtriple amdgcn-unknown-amdhsa -passes='print<divergence>' -disable-output %s 2>&1 | FileCheck %s
4 ; CHECK-NOT: DIVERGENT: %Guard.bb2 = phi i1 [ true, %bb1 ], [ false, %bb0 ]
6 ; Function Attrs: nounwind readnone speculatable
7 declare i32 @llvm.amdgcn.workitem.id.x() #0
9 define protected amdgpu_kernel void @test2(i1 %uni) {
11 %tid.x = call i32 @llvm.amdgcn.workitem.id.x()
12 %i5 = icmp eq i32 %tid.x, -1
13 br i1 %uni, label %bb1, label %bb2
15 bb1: ; preds = %bb2, %bb0
16 %lsr.iv = phi i32 [ 7, %bb0 ], [ %lsr.iv.next, %bb1 ]
17 %lsr.iv.next = add nsw i32 %lsr.iv, -1
18 br i1 %i5, label %bb2, label %bb1
20 bb2: ; preds = %bb2, %bb1
21 %Guard.bb2 = phi i1 [ true, %bb1 ], [ false, %bb0 ]
25 attributes #0 = { nounwind readnone speculatable }