1 ; RUN: opt -hotcoldsplit-threshold=0 -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
16 ; CHECK-NEXT: lifetime.start
17 ; CHECK-NEXT: call void @pluto.cold.1(i1* %tmp8.ce.loc)
18 ; CHECK-NEXT: %tmp8.ce.reload = load i1, i1* %tmp8.ce.loc
19 ; CHECK-NEXT: lifetime.end
20 ; CHECK-NEXT: br label %bb7
23 ; CHECK: %tmp8 = phi i1 [ true, %bb ], [ true, %bb ], [ %tmp8.ce.reload, %codeRepl ]
26 ; CHECK-LABEL: define {{.*}}@pluto.cold.1(
27 ; CHECK: call {{.*}}@sideeffect(i32 1)
28 ; CHECK: call {{.*}}@sink(
29 ; CHECK: call {{.*}}@sideeffect(i32 3)
30 ; CHECK: call {{.*}}@sideeffect(i32 4)
31 ; CHECK: call {{.*}}@sideeffect(i32 5)
32 define void @pluto() {
34 switch i8 undef, label %bb1 [
40 call void @sideeffect(i32 1)
45 br i1 undef, label %bb7, label %bb3
48 call void @sideeffect(i32 3)
52 call void @sideeffect(i32 4)
53 br i1 undef, label %bb5, label %bb6
56 call void @sideeffect(i32 5)
59 bb6: ; preds = %bb5, %bb4
60 %tmp = phi i1 [ true, %bb5 ], [ false, %bb4 ]
61 call void @sideeffect(i32 6)
64 bb7: ; preds = %bb6, %bb2, %bb, %bb
65 %tmp8 = phi i1 [ true, %bb ], [ true, %bb ], [ true, %bb2 ], [ %tmp, %bb6 ]
69 declare void @sink() cold
71 declare void @sideeffect(i32)