1 ; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py
2 ; RUN: opt "-passes=print<scalar-evolution>" -disable-output < %s 2>&1 | FileCheck %s
4 define void @vscale_gep(ptr %p) {
5 ; CHECK-LABEL: 'vscale_gep'
6 ; CHECK-NEXT: Classifying expressions for: @vscale_gep
7 ; CHECK-NEXT: %1 = getelementptr <vscale x 4 x i32>, ptr null, i32 3
8 ; CHECK-NEXT: --> ((48 * vscale) + null) U: [0,-15) S: [-9223372036854775808,9223372036854775793)
9 ; CHECK-NEXT: %2 = getelementptr <vscale x 1 x i64>, ptr %p, i32 1
10 ; CHECK-NEXT: --> ((8 * vscale) + %p) U: full-set S: full-set
11 ; CHECK-NEXT: Determining loop execution counts for: @vscale_gep
13 getelementptr <vscale x 4 x i32>, ptr null, i32 3
14 getelementptr <vscale x 1 x i64>, ptr %p, i32 1
18 define void @vscale_gep_range(ptr %p) vscale_range(2, 16) {
19 ; CHECK-LABEL: 'vscale_gep_range'
20 ; CHECK-NEXT: Classifying expressions for: @vscale_gep_range
21 ; CHECK-NEXT: %1 = getelementptr <vscale x 4 x i32>, ptr null, i32 3
22 ; CHECK-NEXT: --> ((48 * vscale)<nuw><nsw> + null) U: [96,769) S: [96,769)
23 ; CHECK-NEXT: %2 = getelementptr <vscale x 1 x i64>, ptr %p, i32 1
24 ; CHECK-NEXT: --> ((8 * vscale)<nuw><nsw> + %p) U: full-set S: full-set
25 ; CHECK-NEXT: Determining loop execution counts for: @vscale_gep_range
27 getelementptr <vscale x 4 x i32>, ptr null, i32 3
28 getelementptr <vscale x 1 x i64>, ptr %p, i32 1
32 define i64 @vscale_no_range() {
33 ; CHECK-LABEL: 'vscale_no_range'
34 ; CHECK-NEXT: Classifying expressions for: @vscale_no_range
35 ; CHECK-NEXT: %vscale = call i64 @llvm.vscale.i64()
36 ; CHECK-NEXT: --> vscale U: [1,0) S: [1,0)
37 ; CHECK-NEXT: Determining loop execution counts for: @vscale_no_range
39 %vscale = call i64 @llvm.vscale.i64()
43 define i64 @vscale_min_max_range() vscale_range(2, 16) {
44 ; CHECK-LABEL: 'vscale_min_max_range'
45 ; CHECK-NEXT: Classifying expressions for: @vscale_min_max_range
46 ; CHECK-NEXT: %vscale = call i64 @llvm.vscale.i64()
47 ; CHECK-NEXT: --> vscale U: [2,17) S: [2,17)
48 ; CHECK-NEXT: Determining loop execution counts for: @vscale_min_max_range
50 %vscale = call i64 @llvm.vscale.i64()
54 define i64 @vscale_min_range() vscale_range(2, 0) {
55 ; CHECK-LABEL: 'vscale_min_range'
56 ; CHECK-NEXT: Classifying expressions for: @vscale_min_range
57 ; CHECK-NEXT: %vscale = call i64 @llvm.vscale.i64()
58 ; CHECK-NEXT: --> vscale U: [2,0) S: [2,0)
59 ; CHECK-NEXT: Determining loop execution counts for: @vscale_min_range
61 %vscale = call i64 @llvm.vscale.i64()
65 define i64 @vscale_exact_range() vscale_range(2) {
66 ; CHECK-LABEL: 'vscale_exact_range'
67 ; CHECK-NEXT: Classifying expressions for: @vscale_exact_range
68 ; CHECK-NEXT: %vscale = call i64 @llvm.vscale.i64()
69 ; CHECK-NEXT: --> vscale U: [2,3) S: [2,3)
70 ; CHECK-NEXT: Determining loop execution counts for: @vscale_exact_range
72 %vscale = call i64 @llvm.vscale.i64()
76 declare i64 @llvm.vscale.i64()