1 ; RUN: opt -analyze -scalar-evolution < %s | FileCheck %s
3 define void @x(i1* %cond) {
4 ; CHECK-LABEL: Classifying expressions for: @x
9 %idx = phi i8 [ 0, %entry ], [ %idx.inc, %loop ]
10 ; CHECK: %idx = phi i8 [ 0, %entry ], [ %idx.inc, %loop ]
11 ; CHECK-NEXT: --> {0,+,1}<nuw><nsw><%loop> U: [0,-128) S: [0,-128)
13 %idx.inc = add nsw i8 %idx, 1
15 %c = load volatile i1, i1* %cond
16 br i1 %c, label %loop, label %exit
22 define void @y(i8* %addr) {
23 ; CHECK-LABEL: Classifying expressions for: @y
28 %idx = phi i8 [-5, %entry ], [ %idx.inc, %loop ]
29 ; CHECK: %idx = phi i8 [ -5, %entry ], [ %idx.inc, %loop ]
30 ; CHECK-NEXT: --> {-5,+,1}<%loop> U: [-5,6) S: [-5,6)
32 %idx.inc = add i8 %idx, 1
34 %continue = icmp slt i8 %idx.inc, 6
35 br i1 %continue, label %loop, label %exit