1 ; RUN: opt < %s -analyze -enable-new-pm=0 -scalar-evolution | FileCheck %s
2 ; RUN: opt < %s -disable-output "-passes=print<scalar-evolution>" 2>&1 | FileCheck %s
4 ; Check that we convert
7 ; (zext(a) * zext(b))<nuw>
9 declare i32 @get_int();
11 ; Transform doesn't apply here, because %a lacks range metadata.
12 ; CHECK-LABEL: @no_range
13 define void @no_range() {
14 %a = call i32 @get_int()
16 %c = zext i32 %b to i64
18 ; CHECK-NEXT: --> (zext i32 (4 * %a) to i64)
23 define void @range() {
24 %a = call i32 @get_int(), !range !{i32 0, i32 100}
26 %c = zext i32 %b to i64
28 ; CHECK-NEXT: --> (4 * (zext i32 %a to i64))<nuw><nsw>
32 ; CHECK-LABEL: @no_nuw
33 define void @no_nuw() {
34 %a = call i32 @get_int(), !range !{i32 0, i32 3}
37 ; CHECK-NEXT: --> (-100 * %a)<nsw>