1 ; RUN: opt -S -hotcoldsplit -hotcoldsplit-threshold=0 < %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.14.0"
6 ; CHECK-LABEL: define {{.*}}@exit_block_with_same_incoming_vals
7 ; CHECK: call {{.*}}@exit_block_with_same_incoming_vals.cold.1(
8 ; CHECK-NOT: br i1 undef
9 ; CHECK: phi i32 [ 0, %entry ], [ %p.ce.reload, %codeRepl ]
10 define void @exit_block_with_same_incoming_vals(i32 %cond) {
12 %tobool = icmp eq i32 %cond, 0
13 br i1 %tobool, label %if.end, label %coldbb
17 call void @sideeffect()
18 br i1 undef, label %if.end, label %coldbb2
21 %p2 = phi i32 [0, %coldbb], [1, %coldbb2]
22 br i1 undef, label %if.end, label %coldbb2
25 %p = phi i32 [0, %entry], [1, %coldbb], [1, %coldbb2]
29 ; CHECK-LABEL: define {{.*}}@exit_block_with_distinct_incoming_vals
30 ; CHECK: call {{.*}}@exit_block_with_distinct_incoming_vals.cold.1(
31 ; CHECK-NOT: br i1 undef
32 ; CHECK: phi i32 [ 0, %entry ], [ %p.ce.reload, %codeRepl ]
33 define void @exit_block_with_distinct_incoming_vals(i32 %cond) {
35 %tobool = icmp eq i32 %cond, 0
36 br i1 %tobool, label %if.end, label %coldbb
40 call void @sideeffect()
41 br i1 undef, label %if.end, label %coldbb2
44 %p2 = phi i32 [0, %coldbb], [1, %coldbb2]
45 br i1 undef, label %if.end, label %coldbb2
48 %p = phi i32 [0, %entry], [1, %coldbb], [2, %coldbb2]
52 declare void @sink() cold
54 declare void @sideeffect()