2 ; RUN: llc < %s -march=thumb -mcpu=swift -pre-RA-sched=source -enable-misched -verify-misched -debug-only=misched -o - 2>&1 > /dev/null | FileCheck %s
4 ; Loop counter copies should be eliminated.
5 ; There is also a MUL here, but we don't care where it is scheduled.
7 ; CHECK: *** Final schedule for BB#2 ***
12 define i32 @postinc(i32 %a, i32* nocapture %d, i32 %s) nounwind {
14 %cmp4 = icmp eq i32 %a, 0
15 br i1 %cmp4, label %for.end, label %for.body
17 for.body: ; preds = %entry, %for.body
18 %indvars.iv = phi i32 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
19 %s.05 = phi i32 [ %mul, %for.body ], [ 0, %entry ]
20 %indvars.iv.next = add i32 %indvars.iv, %s
21 %arrayidx = getelementptr inbounds i32* %d, i32 %indvars.iv
22 %0 = load i32* %arrayidx, align 4
23 %mul = mul nsw i32 %0, %s.05
24 %exitcond = icmp eq i32 %indvars.iv.next, %a
25 br i1 %exitcond, label %for.end, label %for.body
27 for.end: ; preds = %for.body, %entry
28 %s.0.lcssa = phi i32 [ 0, %entry ], [ %mul, %for.body ]