1; RUN: opt -hotcoldsplit-threshold=0 -hotcoldsplit -S < %s | FileCheck %s 2 3target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128" 4target triple = "x86_64-apple-macosx10.14.0" 5 6; CHECK-LABEL: define {{.*}}@pluto( 7; CHECK-NEXT: bb: 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 12; CHECK-NEXT: ] 13; 14; CHECK: codeRepl: 15; CHECK-NEXT: bitcast 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 21; 22; CHECK: bb7: 23; CHECK: %tmp8 = phi i1 [ true, %bb ], [ true, %bb ], [ %tmp8.ce.reload, %codeRepl ] 24; CHECK: ret void 25 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) 32define void @pluto() { 33bb: 34 switch i8 undef, label %bb1 [ 35 i8 0, label %bb7 36 i8 1, label %bb7 37 ] 38 39bb1: ; preds = %bb 40 call void @sideeffect(i32 1) 41 br label %bb2 42 43bb2: ; preds = %bb1 44 call void @sink() 45 br i1 undef, label %bb7, label %bb3 46 47bb3: ; preds = %bb2 48 call void @sideeffect(i32 3) 49 br label %bb4 50 51bb4: ; preds = %bb3 52 call void @sideeffect(i32 4) 53 br i1 undef, label %bb5, label %bb6 54 55bb5: ; preds = %bb4 56 call void @sideeffect(i32 5) 57 br label %bb6 58 59bb6: ; preds = %bb5, %bb4 60 %tmp = phi i1 [ true, %bb5 ], [ false, %bb4 ] 61 call void @sideeffect(i32 6) 62 br label %bb7 63 64bb7: ; preds = %bb6, %bb2, %bb, %bb 65 %tmp8 = phi i1 [ true, %bb ], [ true, %bb ], [ true, %bb2 ], [ %tmp, %bb6 ] 66 ret void 67} 68 69declare void @sink() cold 70 71declare void @sideeffect(i32) 72