minmax-intrinsics.ll
2.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py
; RUN: opt -analyze -enable-new-pm=0 -scalar-evolution < %s | FileCheck %s
; RUN: opt -disable-output "-passes=print<scalar-evolution>" < %s 2>&1 | FileCheck %s
declare i32 @llvm.umax.i32(i32, i32)
declare i32 @llvm.umin.i32(i32, i32)
declare i32 @llvm.smax.i32(i32, i32)
declare i32 @llvm.smin.i32(i32, i32)
define i32 @umax(i32 %x, i32 %y) {
; CHECK-LABEL: 'umax'
; CHECK-NEXT: Classifying expressions for: @umax
; CHECK-NEXT: %z = call i32 @llvm.umax.i32(i32 %x, i32 %y)
; CHECK-NEXT: --> (%x umax %y) U: full-set S: full-set
; CHECK-NEXT: Determining loop execution counts for: @umax
;
%z = call i32 @llvm.umax.i32(i32 %x, i32 %y)
ret i32 %z
}
define i32 @umin(i32 %x, i32 %y) {
; CHECK-LABEL: 'umin'
; CHECK-NEXT: Classifying expressions for: @umin
; CHECK-NEXT: %z = call i32 @llvm.umin.i32(i32 %x, i32 %y)
; CHECK-NEXT: --> (%x umin %y) U: full-set S: full-set
; CHECK-NEXT: Determining loop execution counts for: @umin
;
%z = call i32 @llvm.umin.i32(i32 %x, i32 %y)
ret i32 %z
}
define i32 @smax(i32 %x, i32 %y) {
; CHECK-LABEL: 'smax'
; CHECK-NEXT: Classifying expressions for: @smax
; CHECK-NEXT: %z = call i32 @llvm.smax.i32(i32 %x, i32 %y)
; CHECK-NEXT: --> (%x smax %y) U: full-set S: full-set
; CHECK-NEXT: Determining loop execution counts for: @smax
;
%z = call i32 @llvm.smax.i32(i32 %x, i32 %y)
ret i32 %z
}
define i32 @smin(i32 %x, i32 %y) {
; CHECK-LABEL: 'smin'
; CHECK-NEXT: Classifying expressions for: @smin
; CHECK-NEXT: %z = call i32 @llvm.smin.i32(i32 %x, i32 %y)
; CHECK-NEXT: --> (%x smin %y) U: full-set S: full-set
; CHECK-NEXT: Determining loop execution counts for: @smin
;
%z = call i32 @llvm.smin.i32(i32 %x, i32 %y)
ret i32 %z
}
define i32 @clamp(i32 %x) {
; CHECK-LABEL: 'clamp'
; CHECK-NEXT: Classifying expressions for: @clamp
; CHECK-NEXT: %y = call i32 @llvm.umax.i32(i32 %x, i32 10)
; CHECK-NEXT: --> (10 umax %x) U: [10,0) S: [10,0)
; CHECK-NEXT: %z = call i32 @llvm.umin.i32(i32 %y, i32 20)
; CHECK-NEXT: --> (20 umin (10 umax %x)) U: [10,21) S: [10,21)
; CHECK-NEXT: Determining loop execution counts for: @clamp
;
%y = call i32 @llvm.umax.i32(i32 %x, i32 10)
%z = call i32 @llvm.umin.i32(i32 %y, i32 20)
ret i32 %z
}