Skip to content

Commit 5e574d4

Browse files
committed
fixup! fixup! fixup! [SCEV] Fix exit condition for recursive loop guard collection
1 parent a2b7e86 commit 5e574d4

File tree

2 files changed

+33
-34
lines changed

2 files changed

+33
-34
lines changed

llvm/test/Analysis/ScalarEvolution/backedge-taken-count-guard-info-with-multiple-predecessors.ll

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,3 +277,36 @@ epilogue:
277277
exit:
278278
ret void
279279
}
280+
281+
declare void @llvm.assume(i1)
282+
283+
; Checks that the presence of assumptions does not interfere with
284+
; exiting loop guard collection via following loop predecessors.
285+
define void @pr120442(i1 %c.1, i1 %c.2) {
286+
; CHECK-LABEL: 'pr120442'
287+
; CHECK-NEXT: Determining loop execution counts for: @pr120442
288+
; CHECK-NEXT: Loop %inner.header: backedge-taken count is i32 0
289+
; CHECK-NEXT: Loop %inner.header: constant max backedge-taken count is i32 0
290+
; CHECK-NEXT: Loop %inner.header: symbolic max backedge-taken count is i32 0
291+
; CHECK-NEXT: Loop %inner.header: Trip multiple is 1
292+
entry:
293+
call void @llvm.assume(i1 %c.1)
294+
call void @llvm.assume(i1 %c.2)
295+
br label %outer.header
296+
297+
outer.header:
298+
%phi7 = phi i32 [ 0, %bb ], [ 0, %entry ]
299+
br label %inner.header
300+
301+
bb:
302+
br i1 false, label %outer.header, label %bb
303+
304+
inner.header:
305+
%phi = phi i32 [ %add, %inner.header ], [ 0, %outer.header ]
306+
%add = add i32 %phi, 1
307+
%icmp = icmp ugt i32 %add, 0
308+
br i1 %icmp, label %exit, label %inner.header
309+
310+
exit:
311+
ret void
312+
}

llvm/test/Analysis/ScalarEvolution/pr120442.ll

Lines changed: 0 additions & 34 deletions
This file was deleted.

0 commit comments

Comments
 (0)