1 ; RUN: opt < %s -analyze -scalar-evolution | FileCheck %s
3 ; Check that we convert
4 ; trunc(C * a) -> trunc(C) * trunc(a)
6 ; CHECK-LABEL: @trunc_of_mul
7 define i8 @trunc_of_mul(i32 %a) {
10 ; CHECK-NEXT: --> (100 * (trunc i32 %a to i8))
11 %c = trunc i32 %b to i8
15 ; Check that we convert
16 ; trunc(C + a) -> trunc(C) + trunc(a)
18 ; CHECK-LABEL: @trunc_of_add
19 define i8 @trunc_of_add(i32 %a) {
22 ; CHECK-NEXT: --> (100 + (trunc i32 %a to i8))
23 %c = trunc i32 %b to i8