1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -passes=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 ; CHECK-NEXT: [[TMP2:%.*]] = icmp eq i32 [[TMP0:%.*]], 0
11 ; CHECK-NEXT: tail call void @_Z10sideeffectv()
12 ; CHECK-NEXT: br i1 [[TMP2]], label [[CODEREPL:%.*]], label [[EXIT:%.*]]
14 ; CHECK-NEXT: call void @foo.cold.1() #[[ATTR2:[0-9]+]]
15 ; CHECK-NEXT: ret void
17 ; CHECK-NEXT: ret void
19 %2 = icmp eq i32 %0, 0
20 tail call void @_Z10sideeffectv()
21 br i1 %2, label %sink, label %exit
24 tail call void @_Z10sideeffectv()
25 call void @llvm.trap()
32 define void @bar(i32) {
34 ; CHECK-NEXT: [[TMP2:%.*]] = icmp eq i32 [[TMP0:%.*]], 0
35 ; CHECK-NEXT: tail call void @_Z10sideeffectv()
36 ; CHECK-NEXT: br i1 [[TMP2]], label [[CODEREPL:%.*]], label [[EXIT:%.*]]
38 ; CHECK-NEXT: call void @bar.cold.1() #[[ATTR2]]
39 ; CHECK-NEXT: ret void
41 ; CHECK-NEXT: ret void
43 %2 = icmp eq i32 %0, 0
44 tail call void @_Z10sideeffectv()
45 br i1 %2, label %sink, label %exit
48 tail call void @_Z10sideeffectv()
49 call void @llvm.trap()
56 declare void @llvm.trap() noreturn cold memory(inaccessiblemem: write)
57 declare void @_Z10sideeffectv()