xref: /llvm-project/llvm/test/Transforms/HotColdSplit/split-cold-2.ll (revision 8ee638fd175245eff88d77e1607e478db237dd41)
1; RUN: opt -passes=hotcoldsplit -hotcoldsplit-threshold=-1 -pass-remarks=hotcoldsplit -S < %s 2>&1 | FileCheck %s
2
3; Make sure this compiles. This test used to fail with an invalid phi node: the
4; two predecessors were outlined and the SSA representation was invalid.
5
6; CHECK: remark: <unknown>:0:0: fun split cold code into fun.cold.1
7; CHECK-LABEL: @fun
8; CHECK: codeRepl:
9; CHECK-NEXT: call void @fun.cold.1
10
11; CHECK: define internal {{.*}}@fun.cold.1{{.*}} [[cold_attr:#[0-9]+]]
12; CHECK: attributes [[cold_attr]] = { {{.*}}noreturn
13
14define void @fun(i1 %arg) {
15entry:
16  br i1 %arg, label %if.then, label %if.else
17
18if.then:
19  ret void
20
21if.else:
22  br label %if.then4
23
24if.then4:
25  br i1 %arg, label %if.then5, label %if.end
26
27if.then5:
28  br label %cleanup
29
30if.end:
31  br label %cleanup
32
33cleanup:
34  %cleanup.dest.slot.0 = phi i32 [ 1, %if.then5 ], [ 0, %if.end ]
35  unreachable
36}
37