-
Notifications
You must be signed in to change notification settings - Fork 15.3k
[SCEV] Fix exit condition for recursive loop guard collection #120442
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
057a47a
a276fdf
a2b7e86
5e574d4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
|
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,35 @@ | ||||||||||
| ; RUN: opt < %s -disable-output "-passes=print<scalar-evolution>" -scalar-evolution-max-iterations=0 -scalar-evolution-classify-expressions=0 2>&1 | FileCheck %s | ||||||||||
|
|
||||||||||
| declare void @llvm.assume(i1) | ||||||||||
|
|
||||||||||
| define void @pr120442() { | ||||||||||
|
||||||||||
| ; CHECK-LABEL: 'pr120442' | ||||||||||
| ; CHECK-NEXT: Determining loop execution counts for: @pr120442 | ||||||||||
| ; CHECK-NEXT: Loop %bb2: backedge-taken count is i32 0 | ||||||||||
| ; CHECK-NEXT: Loop %bb2: constant max backedge-taken count is i32 0 | ||||||||||
| ; CHECK-NEXT: Loop %bb2: symbolic max backedge-taken count is i32 0 | ||||||||||
| ; CHECK-NEXT: Loop %bb2: Trip multiple is 1 | ||||||||||
| ; CHECK-NEXT: Loop %bb1: <multiple exits> Unpredictable backedge-taken count. | ||||||||||
| ; CHECK-NEXT: Loop %bb1: Unpredictable constant max backedge-taken count. | ||||||||||
| ; CHECK-NEXT: Loop %bb1: Unpredictable symbolic max backedge-taken count. | ||||||||||
| bb: | ||||||||||
| call void @llvm.assume(i1 false) | ||||||||||
| call void @llvm.assume(i1 false) | ||||||||||
|
||||||||||
| call void @llvm.assume(i1 false) | |
| call void @llvm.assume(i1 false) | |
| call void @llvm.assume(i1 %c.1) | |
| call void @llvm.assume(i1 %c.2) |
to avoid having immediate UB
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| bb2: | |
| inner.header: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be good to reorder and rename the blocks to make the sturcture easier to see in the test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, simplified the test a bit more
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| bb6: | |
| outer.header: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah I see, the issue is when we have cases where
Termsalready has entries from assumes.This aligns better with the comment immediately above. Might also be worth pulling out the increment of the condition to simplify for the reader
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, I think it is actually counting the number of conditions, due to the early continue above, changed the comment instead (and pulled out the increment) :)