-
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
Merged
+37
−2
Merged
Changes from 3 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
057a47a
[SCEV] Fix exit condition for recursive loop guard collection
juliannagele a276fdf
fixup! [SCEV] Fix exit condition for recursive loop guard collection
juliannagele a2b7e86
fixup! fixup! [SCEV] Fix exit condition for recursive loop guard coll…
juliannagele 5e574d4
fixup! fixup! fixup! [SCEV] Fix exit condition for recursive loop gua…
juliannagele File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| ; 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) | ||
|
|
||
| ; Checks that the presence of assumptions does not interfere with | ||
| ; exiting loop guard collection via following loop predecessors. | ||
| define void @pr120442(i1 %c.1, i1 %c.2) { | ||
| ; CHECK-LABEL: 'pr120442' | ||
| ; CHECK-NEXT: Determining loop execution counts for: @pr120442 | ||
| ; CHECK-NEXT: Loop %inner.header: backedge-taken count is i32 0 | ||
| ; CHECK-NEXT: Loop %inner.header: constant max backedge-taken count is i32 0 | ||
| ; CHECK-NEXT: Loop %inner.header: symbolic max backedge-taken count is i32 0 | ||
| ; CHECK-NEXT: Loop %inner.header: Trip multiple is 1 | ||
| entry: | ||
| call void @llvm.assume(i1 %c.1) | ||
| call void @llvm.assume(i1 %c.2) | ||
| br label %outer.header | ||
|
|
||
| outer.header: | ||
| %phi7 = phi i32 [ 0, %bb ], [ 0, %entry ] | ||
| br label %inner.header | ||
|
|
||
| bb: | ||
| br i1 false, label %outer.header, label %bb | ||
|
|
||
| inner.header: | ||
| %phi = phi i32 [ %add, %inner.header ], [ 0, %outer.header ] | ||
| %add = add i32 %phi, 1 | ||
| %icmp = icmp ugt i32 %add, 0 | ||
| br i1 %icmp, label %exit, label %inner.header | ||
|
|
||
| exit: | ||
| ret void | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Can you please add this test to the same file as the other tests for this code in backedge-taken-count-guard-info-with-multiple-predecessors.ll?
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.
Sure, done