Home | History | Annotate | Download | only in ScalarEvolution
      1 ; RUN: opt -analyze -scalar-evolution -scev-mulops-inline-threshold=1 < %s | FileCheck --check-prefix=CHECK1 %s
      2 ; RUN: opt -analyze -scalar-evolution -scev-mulops-inline-threshold=10 < %s | FileCheck --check-prefix=CHECK10 %s
      3 
      4 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
      5 target triple = "x86_64-unknown-linux-gnu"
      6 
      7 @a = local_unnamed_addr global i32 0, align 4
      8 @b = local_unnamed_addr global i32 0, align 4
      9 
     10 define i32 @main() local_unnamed_addr {
     11 
     12 ; CHECK1: %mul.1 = mul nsw i32 %mul, %mul
     13 ; CHECK1: -->  ((%a.promoted * %a.promoted) * (%a.promoted * %a.promoted))
     14 
     15 ; CHECK10: %mul.1 = mul nsw i32 %mul, %mul
     16 ; CHECK10: -->  (%a.promoted * %a.promoted * %a.promoted * %a.promoted)
     17 
     18 entry:
     19   %a.promoted = load i32, i32* @a, align 4
     20   %mul = mul nsw i32 %a.promoted, %a.promoted
     21   %mul.1 = mul nsw i32 %mul, %mul
     22   %mul.2 = mul nsw i32 %mul.1, %mul.1
     23   %mul.3 = mul nsw i32 %mul.2, %mul.2
     24   %mul.4 = mul nsw i32 %mul.3, %mul.3
     25   %mul.5 = mul nsw i32 %mul.4, %mul.4
     26   store i32 %mul.5, i32* @a, align 4
     27   store i32 31, i32* @b, align 4
     28   ret i32 0
     29 }
     30