1 ; RUN: opt -correlated-propagation -S %s | FileCheck %s
3 target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
4 target triple = "x86_64-apple-macosx10.10.0"
6 ; Function Attrs: noreturn
7 declare void @check1(i1) #1
9 ; Function Attrs: noreturn
10 declare void @check2(i1) #1
12 ; Make sure we propagate the value of %tmp35 to the true/false cases
14 ; CHECK: call void @check1(i1 false)
15 ; CHECK: call void @check2(i1 true)
16 define void @test1(i64 %tmp35) {
18 %tmp36 = icmp sgt i64 %tmp35, 0
19 br i1 %tmp36, label %bb_true, label %bb_false
22 %tmp47 = icmp slt i64 %tmp35, 0
23 tail call void @check1(i1 %tmp47) #4
27 %tmp48 = icmp sle i64 %tmp35, 0
28 tail call void @check2(i1 %tmp48) #4
32 ; Function Attrs: noreturn
33 ; This is the same as test1 but with a diamond to ensure we
34 ; get %tmp36 from both true and false BBs.
36 ; CHECK: call void @check1(i1 false)
37 ; CHECK: call void @check2(i1 true)
38 define void @test2(i64 %tmp35, i1 %inner_cmp) {
40 %tmp36 = icmp sgt i64 %tmp35, 0
41 br i1 %tmp36, label %bb_true, label %bb_false
44 br i1 %inner_cmp, label %inner_true, label %inner_false
53 %tmp47 = icmp slt i64 %tmp35, 0
54 tail call void @check1(i1 %tmp47) #0
58 %tmp48 = icmp sle i64 %tmp35, 0
59 tail call void @check2(i1 %tmp48) #4
63 attributes #4 = { noreturn }