1 ; RUN: opt -S -passes=hotcoldsplit -hotcoldsplit-max-params=1 < %s | FileCheck %s
3 target datalayout = "E-m:a-p:32:32-i64:64-n32"
4 target triple = "powerpc64-ibm-aix7.2.0.0"
6 define void @foo(i32 %cond) {
7 ; CHECK-LABEL: define {{.*}}@foo(
9 ; CHECK: br i1 {{.*}}, label %if.then1, label %codeRepl
10 ; CHECK-LABEL: codeRepl:
11 ; CHECK-NEXT: call void @foo.cold.1
14 %cond.addr = alloca i32
15 store i32 %cond, ptr %cond.addr
16 %0 = load i32, ptr %cond.addr
17 %tobool = icmp ne i32 %0, 0
18 br i1 %tobool, label %if.then, label %if.end2
20 if.then: ; preds = %entry
21 %1 = load i32, ptr %cond.addr
22 call void @sink(i32 %0)
23 %cmp = icmp sgt i32 %1, 10
24 br i1 %cmp, label %if.then1, label %if.else
26 if.then1: ; preds = %if.then
27 call void @sideeffect(i32 2)
30 if.else: ; preds = %if.then
31 call void @sink(i32 0)
32 call void @sideeffect(i32 0)
35 if.end: ; preds = %if.else, %if.then1
38 if.end2: ; preds = %entry
39 call void @sideeffect(i32 1)
43 ; CHECK-LABEL: define {{.*}}@foo.cold.1
44 ; CHECK: call {{.*}}@sink
45 ; CHECK-NEXT: call {{.*}}@sideeffect
47 declare void @sideeffect(i32)
49 declare void @sink(i32) cold