1 ; RUN: opt -passes=hotcoldsplit -hotcoldsplit-threshold=-1 -S < %s | FileCheck %s
2 ; Hot cold splitting should not outline:
3 ; 1. Basic blocks with token type instructions
4 ; 2. Functions with scoped EH personality
6 target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128"
7 target triple = "x86_64-pc-windows-msvc19.0.0"
9 ; CHECK-LABEL: define {{.*}}@with_funclet
10 ; CHECK-NOT: with_funclet.cold
11 define void @with_funclet() personality ptr @__CxxFrameHandler3 {
14 to label %normal unwind label %exception
16 normal: ; preds = %entry
19 exception: ; preds = %entry
20 %0 = cleanuppad within none []
21 call void @terminateYAXXZ() [ "funclet"(token %0) ]
22 br label %continueexception
24 continueexception: ; preds = %exception
28 ; CHECK-LABEL: define {{.*}}@with_personality
29 ; CHECK-NOT: with_personality.cold
30 define void @with_personality(i32 %cond) personality ptr @__CxxFrameHandler3 {
32 %cond.addr = alloca i32
33 store i32 %cond, ptr %cond.addr
34 %0 = load i32, ptr %cond.addr
35 %tobool = icmp ne i32 %0, 0
36 br i1 %tobool, label %if.then, label %if.end2
38 if.then: ; preds = %entry
39 %1 = load i32, ptr %cond.addr
40 %cmp = icmp sgt i32 %1, 10
41 br i1 %cmp, label %if.then1, label %if.else
43 if.then1: ; preds = %if.then
44 call void @sideeffect(i32 0)
47 if.else: ; preds = %if.then
48 call void @sideeffect(i32 1)
51 if.end: ; preds = %if.else, %if.then1
52 call void (...) @sink()
55 if.end2: ; preds = %entry
56 call void @sideeffect(i32 2)
60 declare i32 @__CxxFrameHandler3(...)
62 declare void @fYAXXZ()
64 declare void @bar() #0
66 declare void @terminateYAXXZ()
68 declare void @sideeffect(i32)
70 declare void @sink(...) #0
72 attributes #0 = { cold }