• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; REQUIRES: asserts
2
3; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature
4; RUN: opt -passes='assume-builder,verify' --enable-knowledge-retention --debug-counter=assume-builder-counter-skip=5,assume-builder-counter-count=1 -S %s | FileCheck %s --check-prefixes=COUNTER1
5; RUN: opt -passes='assume-builder,verify' --enable-knowledge-retention --debug-counter=assume-builder-counter-skip=1,assume-builder-counter-count=3 -S %s | FileCheck %s --check-prefixes=COUNTER2
6; RUN: opt -passes='assume-builder,verify' --enable-knowledge-retention --debug-counter=assume-builder-counter-skip=2,assume-builder-counter-count=200 -S %s | FileCheck %s --check-prefixes=COUNTER3
7
8target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
9
10declare void @func(i32*, i32*)
11declare void @func_cold(i32*) cold willreturn nounwind
12declare void @func_strbool(i32*) "no-jump-tables"
13declare void @func_many(i32*) "no-jump-tables" nounwind "less-precise-fpmad" willreturn norecurse
14declare void @func_argattr(i32* align 8, i32* nonnull) nounwind
15declare void @may_throw()
16
17define void @test(i32* %P, i32* %P1, i32* %P2, i32* %P3) {
18; COUNTER1-LABEL: define {{[^@]+}}@test
19; COUNTER1-SAME: (i32* [[P:%.*]], i32* [[P1:%.*]], i32* [[P2:%.*]], i32* [[P3:%.*]])
20; COUNTER1-NEXT:    call void @func(i32* nonnull dereferenceable(16) [[P]], i32* null)
21; COUNTER1-NEXT:    call void @func(i32* dereferenceable(12) [[P1]], i32* nonnull [[P]])
22; COUNTER1-NEXT:    call void @func_cold(i32* dereferenceable(12) [[P1]]) #5
23; COUNTER1-NEXT:    call void @func_cold(i32* dereferenceable(12) [[P1]])
24; COUNTER1-NEXT:    call void @func(i32* [[P1]], i32* [[P]])
25; COUNTER1-NEXT:    call void @func_strbool(i32* [[P1]])
26; COUNTER1-NEXT:    call void @func(i32* dereferenceable(32) [[P]], i32* dereferenceable(8) [[P]])
27; COUNTER1-NEXT:    call void @llvm.assume(i1 true) [ "align"(i32* [[P1]], i64 8) ]
28; COUNTER1-NEXT:    call void @func_many(i32* align 8 [[P1]])
29; COUNTER1-NEXT:    call void @func_argattr(i32* [[P2]], i32* [[P3]])
30; COUNTER1-NEXT:    call void @func(i32* nonnull [[P1]], i32* nonnull [[P]])
31; COUNTER1-NEXT:    ret void
32;
33; COUNTER2-LABEL: define {{[^@]+}}@test
34; COUNTER2-SAME: (i32* [[P:%.*]], i32* [[P1:%.*]], i32* [[P2:%.*]], i32* [[P3:%.*]])
35; COUNTER2-NEXT:    call void @func(i32* nonnull dereferenceable(16) [[P]], i32* null)
36; COUNTER2-NEXT:    call void @llvm.assume(i1 true) [ "dereferenceable"(i32* [[P1]], i64 12), "nonnull"(i32* [[P]]) ]
37; COUNTER2-NEXT:    call void @func(i32* dereferenceable(12) [[P1]], i32* nonnull [[P]])
38; COUNTER2-NEXT:    call void @llvm.assume(i1 true) [ "cold"() ]
39; COUNTER2-NEXT:    call void @func_cold(i32* dereferenceable(12) [[P1]]) #5
40; COUNTER2-NEXT:    call void @llvm.assume(i1 true) [ "cold"() ]
41; COUNTER2-NEXT:    call void @func_cold(i32* dereferenceable(12) [[P1]])
42; COUNTER2-NEXT:    call void @func(i32* [[P1]], i32* [[P]])
43; COUNTER2-NEXT:    call void @func_strbool(i32* [[P1]])
44; COUNTER2-NEXT:    call void @func(i32* dereferenceable(32) [[P]], i32* dereferenceable(8) [[P]])
45; COUNTER2-NEXT:    call void @func_many(i32* align 8 [[P1]])
46; COUNTER2-NEXT:    call void @func_argattr(i32* [[P2]], i32* [[P3]])
47; COUNTER2-NEXT:    call void @func(i32* nonnull [[P1]], i32* nonnull [[P]])
48; COUNTER2-NEXT:    ret void
49;
50; COUNTER3-LABEL: define {{[^@]+}}@test
51; COUNTER3-SAME: (i32* [[P:%.*]], i32* [[P1:%.*]], i32* [[P2:%.*]], i32* [[P3:%.*]])
52; COUNTER3-NEXT:    call void @func(i32* nonnull dereferenceable(16) [[P]], i32* null)
53; COUNTER3-NEXT:    call void @func(i32* dereferenceable(12) [[P1]], i32* nonnull [[P]])
54; COUNTER3-NEXT:    call void @llvm.assume(i1 true) [ "dereferenceable"(i32* [[P1]], i64 12), "cold"() ]
55; COUNTER3-NEXT:    call void @func_cold(i32* dereferenceable(12) [[P1]]) #5
56; COUNTER3-NEXT:    call void @llvm.assume(i1 true) [ "cold"() ]
57; COUNTER3-NEXT:    call void @func_cold(i32* dereferenceable(12) [[P1]])
58; COUNTER3-NEXT:    call void @func(i32* [[P1]], i32* [[P]])
59; COUNTER3-NEXT:    call void @func_strbool(i32* [[P1]])
60; COUNTER3-NEXT:    call void @llvm.assume(i1 true) [ "dereferenceable"(i32* [[P]], i64 32) ]
61; COUNTER3-NEXT:    call void @func(i32* dereferenceable(32) [[P]], i32* dereferenceable(8) [[P]])
62; COUNTER3-NEXT:    call void @llvm.assume(i1 true) [ "align"(i32* [[P1]], i64 8) ]
63; COUNTER3-NEXT:    call void @func_many(i32* align 8 [[P1]])
64; COUNTER3-NEXT:    call void @llvm.assume(i1 true) [ "align"(i32* [[P2]], i64 8), "nonnull"(i32* [[P3]]) ]
65; COUNTER3-NEXT:    call void @func_argattr(i32* [[P2]], i32* [[P3]])
66; COUNTER3-NEXT:    call void @llvm.assume(i1 true) [ "nonnull"(i32* [[P1]]), "nonnull"(i32* [[P]]) ]
67; COUNTER3-NEXT:    call void @func(i32* nonnull [[P1]], i32* nonnull [[P]])
68; COUNTER3-NEXT:    ret void
69;
70  call void @func(i32* nonnull dereferenceable(16) %P, i32* null)
71  call void @func(i32* dereferenceable(12) %P1, i32* nonnull %P)
72  call void @func_cold(i32* dereferenceable(12) %P1) cold
73  call void @func_cold(i32* dereferenceable(12) %P1)
74  call void @func(i32* %P1, i32* %P)
75  call void @func_strbool(i32* %P1)
76  call void @func(i32* dereferenceable(32) %P, i32* dereferenceable(8) %P)
77  call void @func_many(i32* align 8 %P1)
78  call void @func_argattr(i32* %P2, i32* %P3)
79  call void @func(i32* nonnull %P1, i32* nonnull %P)
80  ret void
81}
82