1 ; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py
2 ; RUN: opt < %s "-passes=print<scalar-evolution>" -disable-output 2>&1 | FileCheck %s
4 define i8 @foo(i8 %a) {
6 ; CHECK-NEXT: Classifying expressions for: @foo
7 ; CHECK-NEXT: %t0 = urem i8 %a, 27
8 ; CHECK-NEXT: --> ((-27 * (%a /u 27)) + %a) U: full-set S: full-set
9 ; CHECK-NEXT: Determining loop execution counts for: @foo
15 define i8 @bar(i8 %a) {
17 ; CHECK-NEXT: Classifying expressions for: @bar
18 ; CHECK-NEXT: %t1 = urem i8 %a, 1
19 ; CHECK-NEXT: --> 0 U: [0,1) S: [0,1)
20 ; CHECK-NEXT: Determining loop execution counts for: @bar
26 define i8 @baz(i8 %a) {
28 ; CHECK-NEXT: Classifying expressions for: @baz
29 ; CHECK-NEXT: %t2 = urem i8 %a, 32
30 ; CHECK-NEXT: --> (zext i5 (trunc i8 %a to i5) to i8) U: [0,32) S: [0,32)
31 ; CHECK-NEXT: Determining loop execution counts for: @baz
37 define i8 @qux(i8 %a) {
39 ; CHECK-NEXT: Classifying expressions for: @qux
40 ; CHECK-NEXT: %t3 = urem i8 %a, 2
41 ; CHECK-NEXT: --> (zext i1 (trunc i8 %a to i1) to i8) U: [0,2) S: [0,2)
42 ; CHECK-NEXT: Determining loop execution counts for: @qux
48 define i32 @test_and_not(i32 %arg) {
49 ; CHECK-LABEL: 'test_and_not'
50 ; CHECK-NEXT: Classifying expressions for: @test_and_not
51 ; CHECK-NEXT: %andn = and i32 %arg, -8
52 ; CHECK-NEXT: --> (8 * (%arg /u 8))<nuw> U: [0,-7) S: [-2147483648,2147483641)
53 ; CHECK-NEXT: Determining loop execution counts for: @test_and_not
55 %andn = and i32 %arg, -8
59 define i32 @test_sub_urem(i32 %arg) {
60 ; CHECK-LABEL: 'test_sub_urem'
61 ; CHECK-NEXT: Classifying expressions for: @test_sub_urem
62 ; CHECK-NEXT: %urem = urem i32 %arg, 8
63 ; CHECK-NEXT: --> (zext i3 (trunc i32 %arg to i3) to i32) U: [0,8) S: [0,8)
64 ; CHECK-NEXT: %sub = sub i32 %arg, %urem
65 ; CHECK-NEXT: --> (8 * (%arg /u 8))<nuw> U: [0,-7) S: [-2147483648,2147483641)
66 ; CHECK-NEXT: Determining loop execution counts for: @test_sub_urem
68 %urem = urem i32 %arg, 8
69 %sub = sub i32 %arg, %urem
73 define i32 @test_trunc_zext(i32 %arg) {
74 ; CHECK-LABEL: 'test_trunc_zext'
75 ; CHECK-NEXT: Classifying expressions for: @test_trunc_zext
76 ; CHECK-NEXT: %trunc = trunc i32 %arg to i3
77 ; CHECK-NEXT: --> (trunc i32 %arg to i3) U: full-set S: full-set
78 ; CHECK-NEXT: %zext = zext i3 %trunc to i32
79 ; CHECK-NEXT: --> (zext i3 (trunc i32 %arg to i3) to i32) U: [0,8) S: [0,8)
80 ; CHECK-NEXT: %sub = sub i32 %arg, %zext
81 ; CHECK-NEXT: --> (8 * (%arg /u 8))<nuw> U: [0,-7) S: [-2147483648,2147483641)
82 ; CHECK-NEXT: Determining loop execution counts for: @test_trunc_zext
84 %trunc = trunc i32 %arg to i3
85 %zext = zext i3 %trunc to i32
86 %sub = sub i32 %arg, %zext