1 ; RUN: opt < %s -disable-output "-passes=print<scalar-evolution>" 2>&1 | FileCheck %s
3 ; Check that we convert
6 ; (zext(a) * zext(b))<nuw>
8 declare i32 @get_int();
10 ; Transform doesn't apply here, because %a lacks range metadata.
11 ; CHECK-LABEL: @no_range
12 define void @no_range() {
13 %a = call i32 @get_int()
15 %c = zext i32 %b to i64
17 ; CHECK-NEXT: --> (zext i32 (4 * %a) to i64)
22 define void @range() {
23 %a = call i32 @get_int(), !range !{i32 0, i32 100}
25 %c = zext i32 %b to i64
27 ; CHECK-NEXT: --> (4 * (zext i32 %a to i64))<nuw><nsw>
31 ; CHECK-LABEL: @no_nuw
32 define void @no_nuw() {
33 %a = call i32 @get_int(), !range !{i32 0, i32 3}
36 ; CHECK-NEXT: --> (-100 * %a)<nsw>