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 4 5declare i32 @llvm.uadd.sat.i32(i32, i32) 6declare i32 @llvm.sadd.sat.i32(i32, i32) 7declare i32 @llvm.usub.sat.i32(i32, i32) 8declare i32 @llvm.ssub.sat.i32(i32, i32) 9declare i32 @llvm.ushl.sat.i32(i32, i32) 10declare i32 @llvm.sshl.sat.i32(i32, i32) 11 12define 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 18; 19 %z = call i32 @llvm.uadd.sat.i32(i32 %x, i32 %y) 20 ret i32 %z 21} 22 23define 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 29; 30 %z = call i32 @llvm.sadd.sat.i32(i32 %x, i32 %y) 31 ret i32 %z 32} 33 34define 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 40; 41 %z = call i32 @llvm.usub.sat.i32(i32 %x, i32 %y) 42 ret i32 %z 43} 44 45define 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 51; 52 %z = call i32 @llvm.ssub.sat.i32(i32 %x, i32 %y) 53 ret i32 %z 54} 55 56define 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 62; 63 %z = call i32 @llvm.ushl.sat.i32(i32 %x, i32 %y) 64 ret i32 %z 65} 66 67define 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 73; 74 %z = call i32 @llvm.sshl.sat.i32(i32 %x, i32 %y) 75 ret i32 %z 76} 77