brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.7 KiB · 7fed085 Raw
95 lines · plain
1;2; RUN: opt -mtriple amdgcn-- -passes='print<uniformity>' -disable-output %s 2>&1 | FileCheck %s3;4;5;      Entry (div.cond)6;      /   \7;     B0   B38;     |    |9;     B1   B410;     |    |11;      \  /12;       B5 (phi: divergent)13;       |14;       B6  (div.uni)15;      /   \16;     B7   B917;     |    |18;     B8   B1019;     |    |20;      \  /21;       B11 (phi: uniform)22 23 24; CHECK-LABEL:  'test_ctrl_divergence':25; CHECK-LABEL:  BLOCK Entry26; CHECK:  DIVERGENT:   %div.cond = icmp eq i32 %tid, 027; CHECK:  DIVERGENT:   br i1 %div.cond, label %B3, label %B028;29; CHECK-LABEL:  BLOCK B530; CHECK:  DIVERGENT:   %div_a = phi i32 [ %a0, %B1 ], [ %a1, %B4 ]31; CHECK:  DIVERGENT:   %div_b = phi i32 [ %b0, %B1 ], [ %b1, %B4 ]32;33; CHECK-LABEL:  BLOCK B634; CHECK-NOT:  DIVERGENT:   %uni.cond = icmp35; CHECK-NOT:  DIVERGENT:   br i1 %div.cond36;37; CHECK-LABEL:  BLOCK B1138; CHECK-NOT:  DIVERGENT:   %div_d = phi i3239 40 41define amdgpu_kernel void @test_ctrl_divergence(i32 %a, i32 %b, i32 %c, i32 %d) {42Entry:43  %tid = call i32 @llvm.amdgcn.workitem.id.x()44  %div.cond = icmp eq i32 %tid, 045  br i1 %div.cond, label %B3, label %B0 ; divergent branch46 47B0:48  %a0 = add i32 %a, 149  br label %B150 51B1:52  %b0 = add i32 %b, 253  br label %B554 55B3:56  %a1 = add i32 %a, 1057  br label %B458 59B4:60  %b1 = add i32 %b, 2061  br label %B562 63B5:64  %div_a = phi i32 [%a0, %B1], [%a1,  %B4]65  %div_b = phi i32 [%b0, %B1], [%b1,  %B4]66  br label %B667 68B6:69  %uni.cond = icmp eq i32 %c, 070  br i1 %uni.cond, label %B7, label %B971 72B7:73  %d1 = add i32 %d, 174  br label %B875 76B8:77  br label %B1178 79B9:80  %d2 = add i32 %d, 381  br label %B1082 83B10:84  br label %B1185 86B11:87  %div_d = phi i32 [%d1, %B8], [%d2, %B10]88  ret void89}90 91 92declare i32 @llvm.amdgcn.workitem.id.x() #093 94attributes #0 = {nounwind readnone }95