1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --check-globals --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: @[[G:[a-zA-Z0-9_$"\\.-]+]] = external dso_local global i32, align 4
42 ; CHECK-NEXT: [[TMP2:%.*]] = icmp eq i32 [[TMP0:%.*]], 0
43 ; CHECK-NEXT: tail call void @_Z10sideeffectv()
44 ; CHECK-NEXT: br i1 [[TMP2]], label [[CODEREPL:%.*]], label [[EXIT:%.*]]
46 ; CHECK-NEXT: call void @foo.cold.1() #[[ATTR2:[0-9]+]]
47 ; CHECK-NEXT: ret void
49 ; CHECK-NEXT: ret void
53 ; CHECK-NEXT: [[TMP2:%.*]] = icmp eq i32 [[TMP0:%.*]], 0
54 ; CHECK-NEXT: tail call void @_Z10sideeffectv()
55 ; CHECK-NEXT: br i1 [[TMP2]], label [[CODEREPL:%.*]], label [[EXIT:%.*]]
57 ; CHECK-NEXT: call void @bar.cold.1() #[[ATTR2]]
58 ; CHECK-NEXT: ret void
60 ; CHECK-NEXT: ret void
63 ; CHECK-LABEL: @foo.cold.1(
64 ; CHECK-NEXT: newFuncRoot:
65 ; CHECK-NEXT: br label [[SINK:%.*]]
67 ; CHECK-NEXT: tail call void @_Z10sideeffectv()
68 ; CHECK-NEXT: call void @llvm.trap()
69 ; CHECK-NEXT: unreachable
72 ; CHECK-LABEL: @bar.cold.1(
73 ; CHECK-NEXT: newFuncRoot:
74 ; CHECK-NEXT: br label [[SINK:%.*]]
76 ; CHECK-NEXT: tail call void @_Z10sideeffectv()
77 ; CHECK-NEXT: call void @llvm.trap()
78 ; CHECK-NEXT: unreachable
81 ; CHECK: attributes #[[ATTR0:[0-9]+]] = { cold noreturn nounwind }
82 ; CHECK: attributes #[[ATTR1:[0-9]+]] = { cold minsize noreturn }
83 ; CHECK: attributes #[[ATTR2]] = { noinline }