1 ; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py
2 ; RUN: opt < %s -disable-output "-passes=print<scalar-evolution>" 2>&1 | FileCheck %s
4 source_filename = "input.cpp"
5 target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
7 ; Function Attrs: nofree
8 define ptr @FSE_decompress_usingDTable(ptr %arg, i32 %arg1, i32 %arg2, i32 %arg3) local_unnamed_addr #0 {
9 ; CHECK-LABEL: 'FSE_decompress_usingDTable'
10 ; CHECK-NEXT: Classifying expressions for: @FSE_decompress_usingDTable
11 ; CHECK-NEXT: %i = getelementptr inbounds i8, ptr %arg, i32 %arg2
12 ; CHECK-NEXT: --> (%arg2 + %arg) U: full-set S: full-set
13 ; CHECK-NEXT: %i4 = sub nsw i32 0, %arg1
14 ; CHECK-NEXT: --> (-1 * %arg1) U: full-set S: full-set
15 ; CHECK-NEXT: %i5 = getelementptr inbounds i8, ptr %i, i32 %i4
16 ; CHECK-NEXT: --> ((-1 * %arg1) + %arg2 + %arg) U: full-set S: full-set
17 ; CHECK-NEXT: %i7 = select i1 %i6, i32 %arg2, i32 %arg1
18 ; CHECK-NEXT: --> ((-1 * (ptrtoint ptr %arg to i32)) + (((-1 * %arg1) + (ptrtoint ptr %arg to i32) + %arg2) umin (ptrtoint ptr %arg to i32)) + %arg1) U: full-set S: full-set
19 ; CHECK-NEXT: %i8 = sub i32 %arg3, %i7
20 ; CHECK-NEXT: --> ((-1 * (((-1 * %arg1) + (ptrtoint ptr %arg to i32) + %arg2) umin (ptrtoint ptr %arg to i32))) + (-1 * %arg1) + (ptrtoint ptr %arg to i32) + %arg3) U: full-set S: full-set
21 ; CHECK-NEXT: %i9 = getelementptr inbounds i8, ptr %arg, i32 %i8
22 ; CHECK-NEXT: --> ((-1 * (((-1 * %arg1) + (ptrtoint ptr %arg to i32) + %arg2) umin (ptrtoint ptr %arg to i32))) + (-1 * %arg1) + (ptrtoint ptr %arg to i32) + %arg3 + %arg) U: full-set S: full-set
23 ; CHECK-NEXT: Determining loop execution counts for: @FSE_decompress_usingDTable
26 %i = getelementptr inbounds i8, ptr %arg, i32 %arg2
27 %i4 = sub nsw i32 0, %arg1
28 %i5 = getelementptr inbounds i8, ptr %i, i32 %i4
29 %i6 = icmp ult ptr %i5, %arg
30 %i7 = select i1 %i6, i32 %arg2, i32 %arg1
31 %i8 = sub i32 %arg3, %i7
32 %i9 = getelementptr inbounds i8, ptr %arg, i32 %i8
36 define ptr @test_01(ptr %p) {
37 ; CHECK-LABEL: 'test_01'
38 ; CHECK-NEXT: Classifying expressions for: @test_01
39 ; CHECK-NEXT: %p1 = getelementptr i8, ptr %p, i32 2
40 ; CHECK-NEXT: --> (2 + %p) U: full-set S: full-set
41 ; CHECK-NEXT: %p2 = getelementptr i8, ptr %p, i32 1
42 ; CHECK-NEXT: --> (1 + %p) U: full-set S: full-set
43 ; CHECK-NEXT: %index = select i1 %cmp, i32 2, i32 1
44 ; CHECK-NEXT: --> ((-1 * (ptrtoint ptr %p to i32)) + ((1 + (ptrtoint ptr %p to i32)) umax (2 + (ptrtoint ptr %p to i32)))) U: full-set S: full-set
45 ; CHECK-NEXT: %neg_index = sub i32 0, %index
46 ; CHECK-NEXT: --> ((-1 * ((1 + (ptrtoint ptr %p to i32)) umax (2 + (ptrtoint ptr %p to i32)))) + (ptrtoint ptr %p to i32)) U: full-set S: full-set
47 ; CHECK-NEXT: %gep = getelementptr i8, ptr %p, i32 %neg_index
48 ; CHECK-NEXT: --> ((-1 * ((1 + (ptrtoint ptr %p to i32)) umax (2 + (ptrtoint ptr %p to i32)))) + (ptrtoint ptr %p to i32) + %p) U: full-set S: full-set
49 ; CHECK-NEXT: Determining loop execution counts for: @test_01
51 %p1 = getelementptr i8, ptr %p, i32 2
52 %p2 = getelementptr i8, ptr %p, i32 1
53 %cmp = icmp ugt ptr %p1, %p2
54 %index = select i1 %cmp, i32 2, i32 1
55 %neg_index = sub i32 0, %index
56 %gep = getelementptr i8, ptr %p, i32 %neg_index
60 define ptr @test_02(ptr %p) {
61 ; CHECK-LABEL: 'test_02'
62 ; CHECK-NEXT: Classifying expressions for: @test_02
63 ; CHECK-NEXT: %p1 = getelementptr i8, ptr %p, i32 2
64 ; CHECK-NEXT: --> (2 + %p) U: full-set S: full-set
65 ; CHECK-NEXT: %p2 = getelementptr i8, ptr %p, i32 1
66 ; CHECK-NEXT: --> (1 + %p) U: full-set S: full-set
67 ; CHECK-NEXT: %index = select i1 %cmp, i32 2, i32 1
68 ; CHECK-NEXT: --> ((-1 * (ptrtoint ptr %p to i32)) + ((1 + (ptrtoint ptr %p to i32)) smax (2 + (ptrtoint ptr %p to i32)))) U: full-set S: full-set
69 ; CHECK-NEXT: %neg_index = sub i32 0, %index
70 ; CHECK-NEXT: --> ((-1 * ((1 + (ptrtoint ptr %p to i32)) smax (2 + (ptrtoint ptr %p to i32)))) + (ptrtoint ptr %p to i32)) U: full-set S: full-set
71 ; CHECK-NEXT: %gep = getelementptr i8, ptr %p, i32 %neg_index
72 ; CHECK-NEXT: --> ((-1 * ((1 + (ptrtoint ptr %p to i32)) smax (2 + (ptrtoint ptr %p to i32)))) + (ptrtoint ptr %p to i32) + %p) U: full-set S: full-set
73 ; CHECK-NEXT: Determining loop execution counts for: @test_02
75 %p1 = getelementptr i8, ptr %p, i32 2
76 %p2 = getelementptr i8, ptr %p, i32 1
77 %cmp = icmp sgt ptr %p1, %p2
78 %index = select i1 %cmp, i32 2, i32 1
79 %neg_index = sub i32 0, %index
80 %gep = getelementptr i8, ptr %p, i32 %neg_index
84 define ptr @test_03(ptr %p) {
85 ; CHECK-LABEL: 'test_03'
86 ; CHECK-NEXT: Classifying expressions for: @test_03
87 ; CHECK-NEXT: %p1 = getelementptr i8, ptr %p, i32 2
88 ; CHECK-NEXT: --> (2 + %p) U: full-set S: full-set
89 ; CHECK-NEXT: %p2 = getelementptr i8, ptr %p, i32 1
90 ; CHECK-NEXT: --> (1 + %p) U: full-set S: full-set
91 ; CHECK-NEXT: %index = select i1 %cmp, i32 2, i32 1
92 ; CHECK-NEXT: --> ((-1 * (ptrtoint ptr %p to i32)) + ((1 + (ptrtoint ptr %p to i32)) umin (2 + (ptrtoint ptr %p to i32)))) U: full-set S: full-set
93 ; CHECK-NEXT: %neg_index = sub i32 0, %index
94 ; CHECK-NEXT: --> ((-1 * ((1 + (ptrtoint ptr %p to i32)) umin (2 + (ptrtoint ptr %p to i32)))) + (ptrtoint ptr %p to i32)) U: full-set S: full-set
95 ; CHECK-NEXT: %gep = getelementptr i8, ptr %p, i32 %neg_index
96 ; CHECK-NEXT: --> ((-1 * ((1 + (ptrtoint ptr %p to i32)) umin (2 + (ptrtoint ptr %p to i32)))) + (ptrtoint ptr %p to i32) + %p) U: full-set S: full-set
97 ; CHECK-NEXT: Determining loop execution counts for: @test_03
99 %p1 = getelementptr i8, ptr %p, i32 2
100 %p2 = getelementptr i8, ptr %p, i32 1
101 %cmp = icmp ult ptr %p1, %p2
102 %index = select i1 %cmp, i32 2, i32 1
103 %neg_index = sub i32 0, %index
104 %gep = getelementptr i8, ptr %p, i32 %neg_index
108 define ptr @test_04(ptr %p) {
109 ; CHECK-LABEL: 'test_04'
110 ; CHECK-NEXT: Classifying expressions for: @test_04
111 ; CHECK-NEXT: %p1 = getelementptr i8, ptr %p, i32 2
112 ; CHECK-NEXT: --> (2 + %p) U: full-set S: full-set
113 ; CHECK-NEXT: %p2 = getelementptr i8, ptr %p, i32 1
114 ; CHECK-NEXT: --> (1 + %p) U: full-set S: full-set
115 ; CHECK-NEXT: %index = select i1 %cmp, i32 2, i32 1
116 ; CHECK-NEXT: --> ((-1 * (ptrtoint ptr %p to i32)) + ((1 + (ptrtoint ptr %p to i32)) smin (2 + (ptrtoint ptr %p to i32)))) U: full-set S: full-set
117 ; CHECK-NEXT: %neg_index = sub i32 0, %index
118 ; CHECK-NEXT: --> ((-1 * ((1 + (ptrtoint ptr %p to i32)) smin (2 + (ptrtoint ptr %p to i32)))) + (ptrtoint ptr %p to i32)) U: full-set S: full-set
119 ; CHECK-NEXT: %gep = getelementptr i8, ptr %p, i32 %neg_index
120 ; CHECK-NEXT: --> ((-1 * ((1 + (ptrtoint ptr %p to i32)) smin (2 + (ptrtoint ptr %p to i32)))) + (ptrtoint ptr %p to i32) + %p) U: full-set S: full-set
121 ; CHECK-NEXT: Determining loop execution counts for: @test_04
123 %p1 = getelementptr i8, ptr %p, i32 2
124 %p2 = getelementptr i8, ptr %p, i32 1
125 %cmp = icmp slt ptr %p1, %p2
126 %index = select i1 %cmp, i32 2, i32 1
127 %neg_index = sub i32 0, %index
128 %gep = getelementptr i8, ptr %p, i32 %neg_index
132 attributes #0 = { nofree }