1 ; RUN: opt -S -hotcoldsplit -hotcoldsplit-threshold=0 < %s 2>&1 | FileCheck %s
6 declare void @llvm.lifetime.start.p0i8(i64, i8* nocapture)
8 declare void @llvm.lifetime.end.p0i8(i64, i8* nocapture)
10 declare void @use(%type1**, %type2**)
12 declare void @use2(%type1**, %type2**) cold
14 ; CHECK-LABEL: define {{.*}}@foo(
17 %local1 = alloca %type1*
18 %local2 = alloca %type2*
19 %local1_cast = bitcast %type1** %local1 to i8*
20 %local2_cast = bitcast %type2** %local2 to i8*
21 br i1 undef, label %normalPath, label %outlinedPath
24 call void @use(%type1** %local1, %type2** %local2)
27 ; CHECK-LABEL: codeRepl:
28 ; CHECK: [[local1_cast:%.*]] = bitcast %type1** %local1 to i8*
29 ; CHECK-NEXT: call void @llvm.lifetime.start.p0i8(i64 -1, i8* [[local1_cast]])
30 ; CHECK-NEXT: [[local2_cast:%.*]] = bitcast %type2** %local2 to i8*
31 ; CHECK-NEXT: call void @llvm.lifetime.start.p0i8(i64 -1, i8* [[local2_cast]])
32 ; CHECK-NEXT: call void @foo.cold.1(i8* %local1_cast, i8* %local2_cast
35 call void @llvm.lifetime.start.p0i8(i64 1, i8* %local1_cast)
36 call void @llvm.lifetime.start.p0i8(i64 1, i8* %local2_cast)
37 call void @use2(%type1** %local1, %type2** %local2)
38 call void @llvm.lifetime.end.p0i8(i64 1, i8* %local1_cast)
39 call void @llvm.lifetime.end.p0i8(i64 1, i8* %local2_cast)
40 br label %outlinedPathExit
46 ; CHECK-LABEL: define {{.*}}@foo.cold.1(
47 ; CHECK-NOT: @llvm.lifetime