1 ; RUN: opt -correlated-propagation -S %s | FileCheck %s
2 ; RUN: opt -passes=correlated-propagation -S %s | FileCheck %s
4 target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
5 target triple = "x86_64-apple-macosx10.10.0"
7 ; Function Attrs: noreturn
8 declare void @check1(i1) #1
10 ; Function Attrs: noreturn
11 declare void @check2(i1) #1
13 ; Make sure we propagate the value of %tmp35 to the true/false cases
15 ; CHECK: call void @check1(i1 false)
16 ; CHECK: call void @check2(i1 true)
17 define void @test1(i64 %tmp35) {
19 %tmp36 = icmp sgt i64 %tmp35, 0
20 br i1 %tmp36, label %bb_true, label %bb_false
23 %tmp47 = icmp slt i64 %tmp35, 0
24 tail call void @check1(i1 %tmp47) #4
28 %tmp48 = icmp sle i64 %tmp35, 0
29 tail call void @check2(i1 %tmp48) #4
33 ; Function Attrs: noreturn
34 ; This is the same as test1 but with a diamond to ensure we
35 ; get %tmp36 from both true and false BBs.
37 ; CHECK: call void @check1(i1 false)
38 ; CHECK: call void @check2(i1 true)
39 define void @test2(i64 %tmp35, i1 %inner_cmp) {
41 %tmp36 = icmp sgt i64 %tmp35, 0
42 br i1 %tmp36, label %bb_true, label %bb_false
45 br i1 %inner_cmp, label %inner_true, label %inner_false
54 %tmp47 = icmp slt i64 %tmp35, 0
55 tail call void @check1(i1 %tmp47) #0
59 %tmp48 = icmp sle i64 %tmp35, 0
60 tail call void @check2(i1 %tmp48) #4
64 attributes #4 = { noreturn }