-
Notifications
You must be signed in to change notification settings - Fork 15k
[LV] Ignore user-specified interleave count when unsafe. #153009
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
Merged
Changes from 4 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
938a0e3
[LV] Ignore user-specified interleave count when unsafe.
kmclaughlin-arm 31c6578
- Reworded diagnostic message
kmclaughlin-arm 20fe702
- Handle UserIC as part of selectInterleaveCount
kmclaughlin-arm 17eda94
- Moved UserIC back out of selectInterleaveCount
kmclaughlin-arm 444e58c
- Only set UserIC to 1 if an interleave count > 1 was requested
kmclaughlin-arm 5ad8fb2
- Add an assert for !isSafeForAnyVectorWidth()
kmclaughlin-arm 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
Some comments aren't visible on the classic Files Changed page.
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
31 changes: 31 additions & 0 deletions
31
llvm/test/Transforms/LoopVectorize/unsafe-ic-hint-remark.ll
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,31 @@ | ||||||
| ; RUN: opt -passes=loop-vectorize -pass-remarks-analysis=loop-vectorize -S < %s 2>&1 | FileCheck %s | ||||||
|
|
||||||
| ; Make sure the unsafe user specified interleave count is ignored. | ||||||
|
|
||||||
| ; CHECK: remark: <unknown>:0:0: Ignoring user-specified interleave count due to possibly unsafe dependencies in the loop. | ||||||
| ; CHECK-LABEL: @loop_distance_4 | ||||||
| define void @loop_distance_4(i64 %N, ptr %a, ptr %b) { | ||||||
| entry: | ||||||
| %cmp10 = icmp sgt i64 %N, 4 | ||||||
| br i1 %cmp10, label %for.body, label %for.end | ||||||
|
||||||
|
|
||||||
| for.body: | ||||||
| %indvars.iv = phi i64 [ 4, %entry ], [ %indvars.iv.next, %for.body ] | ||||||
|
||||||
| %indvars.iv = phi i64 [ 4, %entry ], [ %indvars.iv.next, %for.body ] | |
| %iv = phi i64 [ 4, %entry ], [ %iv.next, %loop ] |
for consistency with other tests
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.
If the user didn't specify an interleave hint then
Hints.getInterleave()actually returns 0. IfLVL.isSafeForAnyVectorWidthreturns false and there is no hint you'd be setting UserIC to 1 instead of 0. I wonder if it's better to rewrite this as: