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
4 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
5 target triple = "x86_64-unknown-linux-gnu"
7 @a = local_unnamed_addr global i32 0, align 4
8 @b = local_unnamed_addr global i32 0, align 4
10 define i32 @main() local_unnamed_addr {
12 ; CHECK1: %mul.1 = mul nsw i32 %mul, %mul
13 ; CHECK1: --> ((%a.promoted * %a.promoted) * (%a.promoted * %a.promoted))
15 ; CHECK10: %mul.1 = mul nsw i32 %mul, %mul
16 ; CHECK10: --> (%a.promoted * %a.promoted * %a.promoted * %a.promoted)
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