Xamarin Public Jenkins (auto-signing) 8e12397d70 Imported Upstream version 5.18.0.205
Former-commit-id: 7f59f7e792705db773f1caecdaa823092f4e2927
2018-11-16 08:20:38 +00:00

29 lines
793 B
LLVM

; RUN: opt -mtriple=amdgcn-- -analyze -divergence %s | FileCheck %s
; CHECK-LABEL: 'test1':
; CHECK-NEXT: DIVERGENT: i32 %bound
; CHECK-NEXT: DIVERGENT: %break = icmp sge i32 %counter, %bound
; CHECK-NEXT: DIVERGENT: br i1 %break, label %footer, label %body
; CHECK-NEXT: DIVERGENT: br i1 %break, label %end, label %header
; Note: %counter is not divergent!
define amdgpu_ps void @test1(i32 %bound) {
entry:
br label %header
header:
%counter = phi i32 [ 0, %entry ], [ %counter.footer, %footer ]
%break = icmp sge i32 %counter, %bound
br i1 %break, label %footer, label %body
body:
%counter.next = add i32 %counter, 1
br label %footer
footer:
%counter.footer = phi i32 [ %counter.next, %body ], [ undef, %header ]
br i1 %break, label %end, label %header
end:
ret void
}