1 ; RUN: opt -disable-output "-passes=print<scalar-evolution>" < %s 2>&1 | FileCheck %s
3 ; CHECK: Loop %bb1: backedge-taken count is ((2 * %a.promoted) /u 2)
5 target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
6 target triple = "x86_64-apple-macosx10.10.0"
8 @a = global i8 -127, align 1
9 @b = common global i32 0, align 4
11 declare void @use(i32)
15 %a.promoted = load i8, ptr @a
18 bb1: ; preds = %bb1, %bb
19 %tmp = phi i8 [ %tmp2, %bb1 ], [ %a.promoted, %bb ]
20 %tmp2 = add i8 %tmp, -1
21 %tmp3 = sext i8 %tmp to i32
22 %tmp4 = xor i32 %tmp3, -1
23 %tmp5 = sext i8 %tmp2 to i32
24 %tmpf = sub nsw i32 %tmp4, %tmp5
25 %tmp6 = trunc i32 %tmpf to i8
26 %tmp7 = icmp eq i8 %tmp6, 0
27 br i1 %tmp7, label %bb8, label %bb1
30 store i8 %tmp2, ptr @a
31 store i32 %tmp4, ptr @b
32 %tmp9 = sext i8 %tmp2 to i32
33 call void @use(i32 %tmp9)