1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --include-generated-funcs
2 ; RUN: opt -hotcoldsplit -hotcoldsplit-threshold=0 -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 @G = external dso_local global i32, align 4
8 define void @foo(i32) {
10 tail call void @_Z10sideeffectv()
11 br i1 %2, label %sink, label %exit
14 tail call void @_Z10sideeffectv()
15 call void @llvm.trap()
22 define void @bar(i32) {
23 %2 = icmp eq i32 %0, 0
24 tail call void @_Z10sideeffectv()
25 br i1 %2, label %sink, label %exit
28 tail call void @_Z10sideeffectv()
29 call void @llvm.trap()
36 declare void @llvm.trap() noreturn cold
37 declare void @_Z10sideeffectv()
39 ; CHECK-NEXT: [[TMP2:%.*]] = icmp eq i32 [[TMP0:%.*]], 0
40 ; CHECK-NEXT: tail call void @_Z10sideeffectv()
41 ; CHECK-NEXT: br i1 [[TMP2]], label [[CODEREPL:%.*]], label [[EXIT:%.*]]
43 ; CHECK-NEXT: call void @foo.cold.1() #[[ATTR2:[0-9]+]]
44 ; CHECK-NEXT: ret void
46 ; CHECK-NEXT: ret void
50 ; CHECK-NEXT: [[TMP2:%.*]] = icmp eq i32 [[TMP0:%.*]], 0
51 ; CHECK-NEXT: tail call void @_Z10sideeffectv()
52 ; CHECK-NEXT: br i1 [[TMP2]], label [[CODEREPL:%.*]], label [[EXIT:%.*]]
54 ; CHECK-NEXT: call void @bar.cold.1() #[[ATTR2]]
55 ; CHECK-NEXT: ret void
57 ; CHECK-NEXT: ret void
60 ; CHECK-LABEL: @foo.cold.1(
61 ; CHECK-NEXT: newFuncRoot:
62 ; CHECK-NEXT: br label [[SINK:%.*]]
64 ; CHECK-NEXT: tail call void @_Z10sideeffectv()
65 ; CHECK-NEXT: call void @llvm.trap()
66 ; CHECK-NEXT: unreachable
69 ; CHECK-LABEL: @bar.cold.1(
70 ; CHECK-NEXT: newFuncRoot:
71 ; CHECK-NEXT: br label [[SINK:%.*]]
73 ; CHECK-NEXT: tail call void @_Z10sideeffectv()
74 ; CHECK-NEXT: call void @llvm.trap()
75 ; CHECK-NEXT: unreachable