1 ; REQUIRES: amdgpu-registered-target && x86-registered-target
2 ; RUN: opt < %s -mtriple=amdgcn -jump-threading -S | FileCheck %s -check-prefixes=CHECK,DIVERGENT
3 ; RUN: opt < %s -mtriple=amdgcn -passes=jump-threading -S | FileCheck %s -check-prefixes=CHECK,DIVERGENT
4 ; RUN: opt < %s -mtriple=x86_64 -jump-threading -S | FileCheck %s -check-prefixes=CHECK,UNIFORM
5 ; RUN: opt < %s -mtriple=x86_64 -passes=jump-threading -S | FileCheck %s -check-prefixes=CHECK,UNIFORM
7 ; Here we assure that for the target with no branch divergence usual Jump Threading optimization performed
8 ; For target with branch divergence - no optimization, so the IR is unchanged.
14 define i32 @test(i1 %cond) {
16 br i1 %cond, label %T1, label %F1
31 %A = phi i1 [true, %T1], [false, %F1]
32 %B = phi i32 [%v1, %T1], [%v2, %F1]
33 br i1 %A, label %T2, label %F2
38 ; UNIFORM: %v1 = call i32 @f1()
39 ; UNIFORM: call void @f3()
40 ; UNIFORM: ret i32 %v1
46 ; UNIFORM: %v2 = call i32 @f2()
47 ; UNIFORM: ret i32 %v2