1 ; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py UTC_ARGS: --version 2
2 ; RUN: opt < %s -disable-output "-passes=print<scalar-evolution>" 2>&1 | FileCheck %s
4 define i64 @test00(i64 %a) {
5 ; CHECK-LABEL: 'test00'
6 ; CHECK-NEXT: Classifying expressions for: @test00
7 ; CHECK-NEXT: %add = shl i64 %a, 10
8 ; CHECK-NEXT: --> (1024 * %a) U: [0,-1023) S: [-9223372036854775808,9223372036854774785)
9 ; CHECK-NEXT: %shl = add i64 %add, 256
10 ; CHECK-NEXT: --> (256 + (1024 * %a))<nuw><nsw> U: [256,-767) S: [-9223372036854775552,9223372036854775041)
11 ; CHECK-NEXT: %ashr = ashr exact i64 %shl, 8
12 ; CHECK-NEXT: --> (1 + (sext i56 (4 * (trunc i64 %a to i56)) to i64))<nuw><nsw> U: [1,-2) S: [-36028797018963967,36028797018963966)
13 ; CHECK-NEXT: Determining loop execution counts for: @test00
16 %shl = add i64 %add, 256
17 %ashr = ashr exact i64 %shl, 8
21 define i64 @test01(i64 %a) {
22 ; CHECK-LABEL: 'test01'
23 ; CHECK-NEXT: Classifying expressions for: @test01
24 ; CHECK-NEXT: %add = shl i64 %a, 6
25 ; CHECK-NEXT: --> (64 * %a) U: [0,-63) S: [-9223372036854775808,9223372036854775745)
26 ; CHECK-NEXT: %shl = add i64 %add, 256
27 ; CHECK-NEXT: --> (256 + (64 * %a)) U: [0,-63) S: [-9223372036854775808,9223372036854775745)
28 ; CHECK-NEXT: %ashr = ashr exact i64 %shl, 8
29 ; CHECK-NEXT: --> %ashr U: [-36028797018963968,36028797018963968) S: [-36028797018963968,36028797018963968)
30 ; CHECK-NEXT: Determining loop execution counts for: @test01
33 %shl = add i64 %add, 256
34 %ashr = ashr exact i64 %shl, 8
38 define i64 @test02(i64 %a) {
39 ; CHECK-LABEL: 'test02'
40 ; CHECK-NEXT: Classifying expressions for: @test02
41 ; CHECK-NEXT: %add = shl i64 %a, 12
42 ; CHECK-NEXT: --> (4096 * %a) U: [0,-4095) S: [-9223372036854775808,9223372036854771713)
43 ; CHECK-NEXT: %shl = add i64 %add, 4096
44 ; CHECK-NEXT: --> (4096 + (4096 * %a)) U: [0,-4095) S: [-9223372036854775808,9223372036854771713)
45 ; CHECK-NEXT: %ashr = ashr exact i64 %shl, 8
46 ; CHECK-NEXT: --> (sext i56 (16 + (16 * (trunc i64 %a to i56))) to i64) U: [0,-15) S: [-36028797018963968,36028797018963953)
47 ; CHECK-NEXT: Determining loop execution counts for: @test02
50 %shl = add i64 %add, 4096
51 %ashr = ashr exact i64 %shl, 8