• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: opt -analyze -enable-new-pm=0 -scalar-evolution < %s | FileCheck %s
2; RUN: opt -disable-output "-passes=print<scalar-evolution>" < %s 2>&1 | FileCheck %s
3
4; This loop has no preheader, multiple backedges, etc., but ScalarEvolution
5; should still be able to analyze it.
6
7; CHECK: %i = phi i64 [ 5, %entry ], [ 5, %alt ], [ %i.next, %loop.a ], [ %i.next, %loop.b ]
8; CHECK-NEXT: -->  {5,+,1}<%loop>
9
10define void @foo(i1 %p, i1 %q, i1 %s, i1 %u) {
11entry:
12  br i1 %p, label %loop, label %alt
13
14alt:
15  br i1 %s, label %loop, label %exit
16
17loop:
18  %i = phi i64 [ 5, %entry ], [ 5, %alt ], [ %i.next, %loop.a ], [ %i.next, %loop.b ]
19  %i.next = add i64 %i, 1
20  br i1 %q, label %loop.a, label %loop.b
21
22loop.a:
23  br label %loop
24
25loop.b:
26  br i1 %u, label %loop, label %exit
27
28exit:
29  ret void
30}
31