1 ; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py
2 ; RUN: opt -analyze -enable-new-pm=0 -scalar-evolution < %s | FileCheck %s
3 ; RUN: opt -disable-output "-passes=print<scalar-evolution>" < %s 2>&1 | FileCheck %s
5 declare i32 @llvm.umax.i32(i32, i32)
6 declare i32 @llvm.umin.i32(i32, i32)
7 declare i32 @llvm.smax.i32(i32, i32)
8 declare i32 @llvm.smin.i32(i32, i32)
10 define i32 @umax(i32 %x, i32 %y) {
12 ; CHECK-NEXT: Classifying expressions for: @umax
13 ; CHECK-NEXT: %z = call i32 @llvm.umax.i32(i32 %x, i32 %y)
14 ; CHECK-NEXT: --> (%x umax %y) U: full-set S: full-set
15 ; CHECK-NEXT: Determining loop execution counts for: @umax
17 %z = call i32 @llvm.umax.i32(i32 %x, i32 %y)
21 define i32 @umin(i32 %x, i32 %y) {
23 ; CHECK-NEXT: Classifying expressions for: @umin
24 ; CHECK-NEXT: %z = call i32 @llvm.umin.i32(i32 %x, i32 %y)
25 ; CHECK-NEXT: --> (%x umin %y) U: full-set S: full-set
26 ; CHECK-NEXT: Determining loop execution counts for: @umin
28 %z = call i32 @llvm.umin.i32(i32 %x, i32 %y)
32 define i32 @smax(i32 %x, i32 %y) {
34 ; CHECK-NEXT: Classifying expressions for: @smax
35 ; CHECK-NEXT: %z = call i32 @llvm.smax.i32(i32 %x, i32 %y)
36 ; CHECK-NEXT: --> (%x smax %y) U: full-set S: full-set
37 ; CHECK-NEXT: Determining loop execution counts for: @smax
39 %z = call i32 @llvm.smax.i32(i32 %x, i32 %y)
43 define i32 @smin(i32 %x, i32 %y) {
45 ; CHECK-NEXT: Classifying expressions for: @smin
46 ; CHECK-NEXT: %z = call i32 @llvm.smin.i32(i32 %x, i32 %y)
47 ; CHECK-NEXT: --> (%x smin %y) U: full-set S: full-set
48 ; CHECK-NEXT: Determining loop execution counts for: @smin
50 %z = call i32 @llvm.smin.i32(i32 %x, i32 %y)
54 define i32 @clamp(i32 %x) {
55 ; CHECK-LABEL: 'clamp'
56 ; CHECK-NEXT: Classifying expressions for: @clamp
57 ; CHECK-NEXT: %y = call i32 @llvm.umax.i32(i32 %x, i32 10)
58 ; CHECK-NEXT: --> (10 umax %x) U: [10,0) S: [10,0)
59 ; CHECK-NEXT: %z = call i32 @llvm.umin.i32(i32 %y, i32 20)
60 ; CHECK-NEXT: --> (20 umin (10 umax %x)) U: [10,21) S: [10,21)
61 ; CHECK-NEXT: Determining loop execution counts for: @clamp
63 %y = call i32 @llvm.umax.i32(i32 %x, i32 10)
64 %z = call i32 @llvm.umin.i32(i32 %y, i32 20)