blob: 29bb64ad642b94b65226d8b2237c69a8c2231dd2 [file] [log] [blame]
Andrew Trick0c388582011-10-05 06:23:32 +00001; RUN: opt < %s -analyze -scalar-evolution | FileCheck %s
2
3; Exercise getConstantEvolvingPHIOperands on an interesting loop.
4; This should complete in milliseconds, not minutes.
5
6; Just check that it actually ran trip count analysis.
7; CHECK: Determining loop execution counts for: @test
8define void @test() nounwind {
9entry:
10 br label %loop
11
12loop:
13 %iv = phi i32 [ %30, %loop ], [ 0, %entry ]
14 %0 = add i32 %iv, 1
15 %1 = add i32 %0, 2
16 %2 = add i32 %1, %0
17 %3 = add i32 %2, %1
18 %4 = add i32 %3, %2
19 %5 = add i32 %4, %3
20 %6 = add i32 %5, %4
21 %7 = add i32 %6, %5
22 %8 = add i32 %7, %6
23 %9 = add i32 %8, %7
24 %10 = add i32 %9, %8
25 %11 = add i32 %10, %9
26 %12 = add i32 %11, %10
27 %13 = add i32 %12, %11
28 %14 = add i32 %13, %12
29 %15 = add i32 %14, %13
30 %16 = add i32 %15, %14
31 %17 = add i32 %16, %15
32 %18 = add i32 %17, %16
33 %19 = add i32 %18, %17
34 %20 = add i32 %19, %18
35 %21 = add i32 %20, %19
36 %22 = add i32 %21, %20
37 %23 = add i32 %22, %21
38 %24 = add i32 %23, %22
39 %25 = add i32 %24, %23
40 %26 = add i32 %25, %24
41 %27 = add i32 %26, %25
42 %28 = add i32 %27, %26
43 %29 = add i32 %28, %27
44 %30 = add i32 %29, %28
45 %cmp = icmp eq i32 %30, -108
46 br i1 %cmp, label %exit, label %loop
47
48exit:
49 unreachable
50}