Home | History | Annotate | Download | only in ScalarEvolution
      1 ; RUN: opt -analyze -scalar-evolution -scev-addops-inline-threshold=1 < %s | FileCheck --check-prefix=CHECK1 %s
      2 ; RUN: opt -analyze -scalar-evolution -scev-addops-inline-threshold=10 < %s | FileCheck --check-prefix=CHECK10 %s
      3 
      4 define i32 @foo(i64 %p0, i32 %p1) {
      5 ; CHECK1: %add2 = add nsw i32 %mul1, %add
      6 ; CHECK1-NEXT: -->  ((trunc i64 %p0 to i32) * (1 + (trunc i64 %p0 to i32)) * (1 + %p1))
      7 
      8 ; CHECK10: %add2 = add nsw i32 %mul1, %add
      9 ; CHECK10-NEXT: -->  ((trunc i64 %p0 to i32) * (1 + ((trunc i64 %p0 to i32) * (1 + %p1)) + %p1))
     10 entry:
     11   %tr = trunc i64 %p0 to i32
     12   %mul = mul nsw i32 %tr, %p1
     13   %add = add nsw i32 %mul, %tr
     14   %mul1 = mul nsw i32 %add, %tr
     15   %add2 = add nsw i32 %mul1, %add
     16   ret i32 %add2
     17 }
     18