xref: /llvm-project/llvm/test/Transforms/CodeExtractor/extract-assume.ll (revision 58ca7078ce188af21ea5f924573cb00bdb63cbb6)
1; RUN: opt -passes="function(slp-vectorizer),module(hotcoldsplit),function(slp-vectorizer,print<assumptions>)" -hotcoldsplit-threshold=-1 -disable-output %s 2>&1 | FileCheck %s
2;
3; Make sure this compiles. Check that function assumption cache is refreshed
4; after extracting blocks with assume calls from the function.
5
6; CHECK: Cached assumptions for function: fun
7; CHECK-NEXT: Cached assumptions for function: fun.cold
8; CHECK-NOT: icmp uge
9
10declare void @fun2(i32) #0
11
12define void @fun(i32 %x, i1 %arg) {
13entry:
14  br i1 %arg, label %if.then, label %if.else
15
16if.then:
17  ret void
18
19if.else:
20  %cmp = icmp uge i32 %x, 64
21  call void @llvm.assume(i1 %cmp)
22  call void @fun2(i32 %x)
23  unreachable
24}
25
26declare void @llvm.assume(i1) #1
27
28attributes #0 = { alwaysinline }
29attributes #1 = { nounwind }
30