Skip to content

Commit 0b4f265

Browse files
committed
Switch to canonical loop induction form
1 parent d0b6eca commit 0b4f265

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

llvm/test/Transforms/LoopVectorize/AArch64/bug165359.ll

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ entry:
1212

1313
loop:
1414
%acc0 = phi double [ %fadd0, %loop ], [ %d0, %entry ]
15-
%counter = phi i64 [ %counter_updated, %loop ], [ %loop_count, %entry ]
15+
%counter = phi i64 [ 0, %entry ], [ %counter_updated, %loop ]
1616
%fadd0 = fadd double %acc0, %d1
17-
%counter_updated = add nsw i64 %counter, -1
18-
%exit_cond = icmp samesign ugt i64 %counter, 1
19-
br i1 %exit_cond, label %loop, label %loopexit
17+
%counter_updated = add nsw nuw i64 %counter, 1
18+
%exit_cond = icmp eq i64 %counter_updated, %loop_count
19+
br i1 %exit_cond, label %loopexit, label %loop
2020

2121
loopexit:
2222
ret double %fadd0

0 commit comments

Comments
 (0)