1 ; RUN: opt -S -jump-threading < %s | FileCheck %s
4 declare void @llvm.assume(i1)
6 define i1 @test1(i1 %cond) {
8 br i1 %cond, label %taken, label %not_taken
11 ; CHECK: br i1 %cond, label %no, label %yes
15 %res1 = call i8* @escape()
16 %a = icmp eq i8* %res1, null
17 tail call void @llvm.assume(i1 %a)
20 %res2 = call i8* @escape()
21 %b = icmp ne i8* %res2, null
22 tail call void @llvm.assume(i1 %b)
25 ; An assume that can be used to simplify this comparison dominates each
26 ; predecessor branch (although no assume dominates the cmp itself). Make sure
27 ; this still can be simplified.
30 %res = phi i8* [ %res1, %taken ], [ %res2, %not_taken ]
31 %cnd = icmp ne i8* %res, null
32 br i1 %cnd, label %yes, label %no