1 ; RUN: opt -S -jump-threading -dce < %s | FileCheck %s
2 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
3 target triple = "x86_64-unknown-linux-gnu"
5 ; Function Attrs: nounwind uwtable
6 define i32 @test1(i32 %a, i32 %b) #0 {
8 %cmp = icmp sgt i32 %a, 5
9 tail call void @llvm.assume(i1 %cmp)
10 %cmp1 = icmp sgt i32 %b, 1234
11 br i1 %cmp1, label %if.then, label %if.else
14 ; CHECK: icmp sgt i32 %a, 5
15 ; CHECK: call void @llvm.assume
16 ; CHECK-NOT: icmp sgt i32 %a, 3
19 if.then: ; preds = %entry
20 %cmp2 = icmp sgt i32 %a, 3
21 br i1 %cmp2, label %if.then3, label %return
23 if.then3: ; preds = %if.then
24 tail call void (...) @bar() #1
27 if.else: ; preds = %entry
28 tail call void (...) @car() #1
31 return: ; preds = %if.else, %if.then, %if.then3
32 %retval.0 = phi i32 [ 1, %if.then3 ], [ 0, %if.then ], [ 0, %if.else ]
36 define i32 @test2(i32 %a) #0 {
38 %cmp = icmp sgt i32 %a, 5
39 tail call void @llvm.assume(i1 %cmp)
40 %cmp1 = icmp sgt i32 %a, 3
41 br i1 %cmp1, label %if.then, label %return
44 ; CHECK: icmp sgt i32 %a, 5
45 ; CHECK: tail call void @llvm.assume
46 ; CHECK: tail call void (...) @bar()
50 if.then: ; preds = %entry
51 tail call void (...) @bar() #1
54 return: ; preds = %entry, %if.then
55 %retval.0 = phi i32 [ 1, %if.then ], [ 0, %entry ]
59 ; Function Attrs: nounwind
60 declare void @llvm.assume(i1) #1
62 declare void @bar(...)
64 declare void @car(...)
66 attributes #0 = { nounwind uwtable }
67 attributes #1 = { nounwind }