stale-assume-in-original-func.ll
718 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
; RUN: opt -S -hotcoldsplit -hotcoldsplit-threshold=-1 < %s 2>&1 | FileCheck %s
; CHECK-LABEL: define {{.*}} @foo(
; CHECK-NOT: llvm.assume
; CHECK: call void @foo.cold.1()
; CHECK: llvm.assume
; CHECK-NEXT: ret void
; CHECK-LABEL: define {{.*}} @foo.cold.1(
; CHECK-NOT: llvm.assume
; CHECK: call void @cold()
; CHECK-NOT: llvm.assume
; CHECK: }
define void @foo(i1 %cond) {
entry:
br i1 %cond, label %cold, label %cont
cold:
call void @llvm.assume(i1 %cond)
call void @cold()
br label %cont
cont:
%cmp = icmp eq i1 %cond, true
br i1 %cmp, label %exit1, label %exit2
exit1:
call void @llvm.assume(i1 %cond)
ret void
exit2:
ret void
}
declare void @llvm.assume(i1)
declare void @cold() cold