1 ; RUN: llc -mtriple=arm64-unknown-unknown -print-lsr-output < %s 2>&1 | FileCheck %s
5 ; Verify that redundant adds aren't inserted by LSR.
7 define void @bar(ptr %A) {
12 ; CHECK-LABEL: while.cond:
13 ; CHECK: add i64 %lsr.iv, 1
14 ; CHECK-NOT: add i64 %lsr.iv, 1
15 ; CHECK-LABEL: land.rhs:
16 %indvars.iv28 = phi i64 [ %indvars.iv.next29, %land.rhs ], [ 50, %entry ]
17 %cmp = icmp sgt i64 %indvars.iv28, 0
18 br i1 %cmp, label %land.rhs, label %while.end
21 %indvars.iv.next29 = add nsw i64 %indvars.iv28, -1
22 %arrayidx = getelementptr inbounds double, ptr %A, i64 %indvars.iv.next29
23 %Aload = load double, ptr %arrayidx, align 8
24 %cmp1 = fcmp oeq double %Aload, 0.000000e+00
25 br i1 %cmp1, label %while.cond, label %if.end
28 %indvars.iv28.lcssa = phi i64 [ %indvars.iv28, %while.cond ]
29 tail call void @foo(i64 %indvars.iv28.lcssa)