• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: opt -hotcoldsplit -hotcoldsplit-threshold=-1 -pass-remarks=hotcoldsplit -enable-cold-section=true -hotcoldsplit-cold-section-name="__cold_custom" -S < %s 2>&1 | FileCheck %s
2; RUN: opt -passes=hotcoldsplit -hotcoldsplit-threshold=-1 -pass-remarks=hotcoldsplit -enable-cold-section=true -hotcoldsplit-cold-section-name="__cold_custom" -S < %s 2>&1 | FileCheck %s
3
4; This test case is copied over from split-cold-2.ll, modified
5; to test the `-enable-cold-section` and `-hotcoldsplit-cold-section-name`
6; parameters in opt.
7; Make sure this compiles. This test used to fail with an invalid phi node: the
8; two predecessors were outlined and the SSA representation was invalid.
9
10; CHECK: remark: <unknown>:0:0: fun split cold code into fun.cold.1
11; CHECK-LABEL: @fun
12; CHECK: codeRepl:
13; CHECK-NEXT: call void @fun.cold.1
14
15; CHECK: define {{.*}}@fun.cold.1{{.*}} [[cold_attr:#[0-9]+]] section "__cold_custom"
16; CHECK: attributes [[cold_attr]] = { {{.*}}noreturn
17
18define void @fun() {
19entry:
20  br i1 undef, label %if.then, label %if.else
21
22if.then:
23  ret void
24
25if.else:
26  br label %if.then4
27
28if.then4:
29  br i1 undef, label %if.then5, label %if.end
30
31if.then5:
32  br label %cleanup
33
34if.end:
35  br label %cleanup
36
37cleanup:
38  %cleanup.dest.slot.0 = phi i32 [ 1, %if.then5 ], [ 0, %if.end ]
39  unreachable
40}
41