1 # RUN: llc -mtriple=amdgcn-- -run-pass=print-machine-uniformity -o - %s 2>&1 | FileCheck %s
8 # CHECK-LABEL: MachineUniformityInfo for function: cycle_diverge_enter
9 # CHECK-NEXT: CYCLES ASSSUMED DIVERGENT:
10 # CHECK-NEXT: depth=1: entries(bb.2 bb.1)
11 # CHECK-NEXT: CYCLES WITH DIVERGENT EXIT:
12 # CHECK-NEXT: depth=1: entries(bb.2 bb.1)
14 name: cycle_diverge_enter
15 tracksRegLiveness: true
18 successors: %bb.1, %bb.2
20 %0:_(s32) = G_IMPLICIT_DEF
21 %1:_(s32) = G_CONSTANT i32 0
22 %2:_(s32) = G_IMPLICIT_DEF
23 %3:_(s32) = G_CONSTANT i32 1
24 %4:_(s32) = G_INTRINSIC intrinsic(@llvm.amdgcn.workitem.id.x)
25 %6:_(s1) = G_ICMP intpred(slt), %4(s32), %1 ; DIVERGENT CONDITION
26 %7:_(s1) = G_ICMP intpred(slt), %2(s32), %1 ; UNIFORM CONDITION
27 G_BRCOND %6(s1), %bb.1 ; divergent branch
32 %8:_(s32) = G_PHI %1(s32), %bb.0, %0(s32), %bb.2
35 successors: %bb.1, %bb.3
37 %9:_(s32) = G_PHI %2(s32), %bb.1, %3(s32), %bb.0
38 %10:_(s1) = G_ICMP intpred(eq), %9(s32), %1(s32)
39 G_BRCOND %10(s1), %bb.3 ; divergent branch
43 %11:_(s32), %12:_(s1) = G_UADDO %9, %3
49 # CHECK-LABEL: MachineUniformityInfo for function: cycle_diverge_exit
50 # CHECK: DIVERGENT: %{{[0-9]*}}: %{{[0-9]*}}:_(s32), %{{[0-9]*}}:_(s1) = G_UADDO %8:_, %{{[0-9]*}}:_
57 name: cycle_diverge_exit
58 tracksRegLiveness: true
61 successors: %bb.1, %bb.2
63 %0:_(s32) = G_IMPLICIT_DEF
64 %1:_(s32) = G_CONSTANT i32 0
65 %2:_(s32) = G_IMPLICIT_DEF
66 %3:_(s32) = G_CONSTANT i32 1
67 %4:_(s32) = G_INTRINSIC intrinsic(@llvm.amdgcn.workitem.id.x)
68 %6:_(s1) = G_ICMP intpred(slt), %4(s32), %1 ; DIVERGENT CONDITION
69 %7:_(s1) = G_ICMP intpred(slt), %2(s32), %1 ; UNIFORM CONDITION
70 G_BRCOND %7(s1), %bb.1 ; uniform branch
75 %8:_(s32) = G_PHI %1(s32), %bb.0, %0(s32), %bb.2
78 successors: %bb.1, %bb.3
80 %9:_(s32) = G_PHI %2(s32), %bb.1, %3(s32), %bb.0
81 %10:_(s1) = G_ICMP intpred(sgt), %9(s32), %1(s32)
82 G_BRCOND %6(s1), %bb.3 ; divergent branch
86 %11:_(s32), %12:_(s1) = G_UADDO %9, %3