1 ; RUN: opt -hotcoldsplit-threshold=0 -passes=hotcoldsplit -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.14.0"
6 ; CHECK-LABEL: define {{.*}}@pluto(
8 ; CHECK-NEXT: %tmp8.ce.loc = alloca i1
9 ; CHECK-NEXT: switch i8 undef, label %codeRepl [
10 ; CHECK-NEXT: i8 0, label %bb7
11 ; CHECK-NEXT: i8 1, label %bb7
15 ; CHECK-NEXT: lifetime.start
16 ; CHECK-NEXT: call void @pluto.cold.1(ptr %tmp8.ce.loc)
17 ; CHECK-NEXT: %tmp8.ce.reload = load i1, ptr %tmp8.ce.loc
18 ; CHECK-NEXT: lifetime.end
19 ; CHECK-NEXT: br label %bb7
22 ; CHECK: %tmp8 = phi i1 [ true, %bb ], [ true, %bb ], [ %tmp8.ce.reload, %codeRepl ]
25 ; CHECK-LABEL: define {{.*}}@pluto.cold.1(
26 ; CHECK: call {{.*}}@sideeffect(i32 1)
27 ; CHECK: call {{.*}}@sink(
28 ; CHECK: call {{.*}}@sideeffect(i32 3)
29 ; CHECK: call {{.*}}@sideeffect(i32 4)
30 ; CHECK: call {{.*}}@sideeffect(i32 5)
31 define void @pluto() {
33 switch i8 undef, label %bb1 [
39 call void @sideeffect(i32 1)
44 br i1 undef, label %bb7, label %bb3
47 call void @sideeffect(i32 3)
51 call void @sideeffect(i32 4)
52 br i1 undef, label %bb5, label %bb6
55 call void @sideeffect(i32 5)
58 bb6: ; preds = %bb5, %bb4
59 %tmp = phi i1 [ true, %bb5 ], [ false, %bb4 ]
60 call void @sideeffect(i32 6)
63 bb7: ; preds = %bb6, %bb2, %bb, %bb
64 %tmp8 = phi i1 [ true, %bb ], [ true, %bb ], [ true, %bb2 ], [ %tmp, %bb6 ]
68 declare void @sink() cold
70 declare void @sideeffect(i32)