30 lines · plain
1; RUN: opt -disable-output "-passes=print<scalar-evolution>" < %s 2>&1 | FileCheck %s2 3; This loop has no preheader, multiple backedges, etc., but ScalarEvolution4; should still be able to analyze it.5 6; CHECK: %i = phi i64 [ 5, %entry ], [ 5, %alt ], [ %i.next, %loop.a ], [ %i.next, %loop.b ]7; CHECK-NEXT: --> {5,+,1}<%loop>8 9define void @foo(i1 %p, i1 %q, i1 %s, i1 %u) {10entry:11 br i1 %p, label %loop, label %alt12 13alt:14 br i1 %s, label %loop, label %exit15 16loop:17 %i = phi i64 [ 5, %entry ], [ 5, %alt ], [ %i.next, %loop.a ], [ %i.next, %loop.b ]18 %i.next = add i64 %i, 119 br i1 %q, label %loop.a, label %loop.b20 21loop.a:22 br label %loop23 24loop.b:25 br i1 %u, label %loop, label %exit26 27exit:28 ret void29}30