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.uadd.sat.i32(i32, i32)
6 declare i32 @llvm.sadd.sat.i32(i32, i32)
7 declare i32 @llvm.usub.sat.i32(i32, i32)
8 declare i32 @llvm.ssub.sat.i32(i32, i32)
9 declare i32 @llvm.ushl.sat.i32(i32, i32)
10 declare i32 @llvm.sshl.sat.i32(i32, i32)
12 define i32 @uadd_sat(i32 %x, i32 %y) {
13 ; CHECK-LABEL: 'uadd_sat'
14 ; CHECK-NEXT: Classifying expressions for: @uadd_sat
15 ; CHECK-NEXT: %z = call i32 @llvm.uadd.sat.i32(i32 %x, i32 %y)
16 ; CHECK-NEXT: --> (((-1 + (-1 * %y)) umin %x) + %y)<nuw> U: full-set S: full-set
17 ; CHECK-NEXT: Determining loop execution counts for: @uadd_sat
19 %z = call i32 @llvm.uadd.sat.i32(i32 %x, i32 %y)
23 define i32 @sadd_sat(i32 %x, i32 %y) {
24 ; CHECK-LABEL: 'sadd_sat'
25 ; CHECK-NEXT: Classifying expressions for: @sadd_sat
26 ; CHECK-NEXT: %z = call i32 @llvm.sadd.sat.i32(i32 %x, i32 %y)
27 ; CHECK-NEXT: --> %z U: full-set S: full-set
28 ; CHECK-NEXT: Determining loop execution counts for: @sadd_sat
30 %z = call i32 @llvm.sadd.sat.i32(i32 %x, i32 %y)
34 define i32 @usub_sat(i32 %x, i32 %y) {
35 ; CHECK-LABEL: 'usub_sat'
36 ; CHECK-NEXT: Classifying expressions for: @usub_sat
37 ; CHECK-NEXT: %z = call i32 @llvm.usub.sat.i32(i32 %x, i32 %y)
38 ; CHECK-NEXT: --> ((-1 * (%x umin %y)) + %x) U: full-set S: full-set
39 ; CHECK-NEXT: Determining loop execution counts for: @usub_sat
41 %z = call i32 @llvm.usub.sat.i32(i32 %x, i32 %y)
45 define i32 @ssub_sat(i32 %x, i32 %y) {
46 ; CHECK-LABEL: 'ssub_sat'
47 ; CHECK-NEXT: Classifying expressions for: @ssub_sat
48 ; CHECK-NEXT: %z = call i32 @llvm.ssub.sat.i32(i32 %x, i32 %y)
49 ; CHECK-NEXT: --> %z U: full-set S: full-set
50 ; CHECK-NEXT: Determining loop execution counts for: @ssub_sat
52 %z = call i32 @llvm.ssub.sat.i32(i32 %x, i32 %y)
56 define i32 @ushl_sat(i32 %x, i32 %y) {
57 ; CHECK-LABEL: 'ushl_sat'
58 ; CHECK-NEXT: Classifying expressions for: @ushl_sat
59 ; CHECK-NEXT: %z = call i32 @llvm.ushl.sat.i32(i32 %x, i32 %y)
60 ; CHECK-NEXT: --> %z U: full-set S: full-set
61 ; CHECK-NEXT: Determining loop execution counts for: @ushl_sat
63 %z = call i32 @llvm.ushl.sat.i32(i32 %x, i32 %y)
67 define i32 @sshl_sat(i32 %x, i32 %y) {
68 ; CHECK-LABEL: 'sshl_sat'
69 ; CHECK-NEXT: Classifying expressions for: @sshl_sat
70 ; CHECK-NEXT: %z = call i32 @llvm.sshl.sat.i32(i32 %x, i32 %y)
71 ; CHECK-NEXT: --> %z U: full-set S: full-set
72 ; CHECK-NEXT: Determining loop execution counts for: @sshl_sat
74 %z = call i32 @llvm.sshl.sat.i32(i32 %x, i32 %y)