Summary: This is patch 1 of the new DivergenceAnalysis (https://reviews.llvm.org/D50433). The purpose of this patch is to free up the name DivergenceAnalysis for the new generic implementation. The generic implementation class will be shared by specialized divergence analysis classes. Patch by: Simon Moll Reviewed By: nhaehnle Subscribers: jvesely, jholewinski, arsenm, nhaehnle, mgorny, jfb, llvm-commits Differential Revision: https://reviews.llvm.org/D50434 Change-Id: Ie8146b11be2c50d5312f30e11c7a3036a15b48cb llvm-svn: 341071
32 lines
884 B
LLVM
32 lines
884 B
LLVM
; RUN: opt -mtriple=amdgcn-- -analyze -divergence %s | FileCheck %s
|
|
|
|
; CHECK-LABEL: 'test1':
|
|
; CHECK-NEXT: DIVERGENT: i32 %bound
|
|
; CHECK: {{^ *}}%counter =
|
|
; CHECK-NEXT: DIVERGENT: %break = icmp sge i32 %counter, %bound
|
|
; CHECK-NEXT: DIVERGENT: br i1 %break, label %footer, label %body
|
|
; CHECK: {{^ *}}%counter.next =
|
|
; CHECK: {{^ *}}%counter.footer =
|
|
; CHECK: 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
|
|
}
|