-
Notifications
You must be signed in to change notification settings - Fork 13.6k
[AMDGPU] Add MachineVerifier check to detect illegal copies from vector register to SGPR #105494
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 all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
28724d6
[AMDGPU] Add MachineVerifer check to detect illegal copies from VGPR …
e5f73a0
Handle review comments
9c89b57
Handle Review comments
f23e81a
Merge branch 'main' into machine-verify
320bc25
Handle review comments
bdef10e
Merge branch 'main' into machine-verify
b503184
Move testcase into AMDGPU directory
e87b685
Modify subreg testcase
ee2acc2
Fix trailing whitespace in SIInstrInfo.cpp
a99440e
Format testcase
36ca00d
Merge branch 'main' into machine-verify
2626818
Handle review changes
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
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 |
---|---|---|
|
@@ -112,7 +112,6 @@ body: | | |
S_BRANCH %bb.2 | ||
... | ||
|
||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unwanted diff. This file shouldn't have any change now. |
||
--- | ||
name: phi_moveimm_bad_opcode_input | ||
tracksRegLiveness: true | ||
|
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
59 changes: 59 additions & 0 deletions
59
llvm/test/MachineVerifier/AMDGPU/fix-illegal-vector-copies.mir
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,59 @@ | ||
# RUN: not --crash llc -march=amdgcn -mcpu=gfx1200 -run-pass=none -o /dev/null %s 2>&1 | FileCheck %s | ||
|
||
--- | ||
name: fix-illegal-vector-copies | ||
tracksRegLiveness: true | ||
machineFunctionInfo: | ||
isEntryFunction: true | ||
body: | | ||
bb.0: | ||
%0:vgpr_32 = IMPLICIT_DEF | ||
%0:vgpr_32 = IMPLICIT_DEF ; Break SSA format | ||
%1:vgpr_32 = IMPLICIT_DEF | ||
%2:sgpr_32 = IMPLICIT_DEF | ||
%3:sgpr_32 = IMPLICIT_DEF | ||
%4:agpr_32 = IMPLICIT_DEF | ||
%5:agpr_32 = IMPLICIT_DEF | ||
|
||
; copy from virtual VGPR to virtual SGPR | ||
; CHECK: *** Bad machine code: illegal copy from vector register to SGPR *** | ||
; CHECK: - instruction: %6:sgpr_32 = COPY %0:vgpr_32 | ||
%6:sgpr_32 = COPY %0:vgpr_32 | ||
|
||
; copy from virtual VGPR to physical SGPR | ||
; CHECK: *** Bad machine code: illegal copy from vector register to SGPR *** | ||
; CHECK: - instruction: $sgpr0 = COPY %0:vgpr_32 | ||
$sgpr0 = COPY %0:vgpr_32 | ||
|
||
; copy from physical VGPR to physical SGPR | ||
; CHECK: *** Bad machine code: illegal copy from vector register to SGPR *** | ||
; CHECK: - instruction: $sgpr1 = COPY $vgpr0 | ||
$sgpr1 = COPY $vgpr0 | ||
|
||
; copy from virtual AGPR to virtual SGPR | ||
; CHECK: *** Bad machine code: illegal copy from vector register to SGPR *** | ||
; CHECK: - instruction: %7:sgpr_32 = COPY %4:agpr_32 | ||
%7:sgpr_32 = COPY %4:agpr_32 | ||
|
||
; copy from virtual AGPR to physical SGPR | ||
; CHECK: *** Bad machine code: illegal copy from vector register to SGPR *** | ||
; CHECK: - instruction: $sgpr2 = COPY %4:agpr_32 | ||
$sgpr2 = COPY %4:agpr_32 | ||
|
||
; copy from physical AGPR to physical SGPR | ||
; CHECK: *** Bad machine code: illegal copy from vector register to SGPR *** | ||
; CHECK: - instruction: $sgpr3 = COPY $agpr0 | ||
$sgpr3 = COPY $agpr0 | ||
|
||
; copy from tuple of physical VGPRs to tuple of physical SGPRs | ||
; CHECK: *** Bad machine code: illegal copy from vector register to SGPR *** | ||
; CHECK: - instruction: $sgpr4_sgpr5 = COPY $vgpr0_vgpr1 | ||
$sgpr4_sgpr5 = COPY $vgpr0_vgpr1 | ||
|
||
; copy from tuple of physical AGPRs to tuple of physical SGPRs | ||
; CHECK: *** Bad machine code: illegal copy from vector register to SGPR *** | ||
; CHECK: - instruction: $sgpr6_sgpr7 = COPY $agpr0_agpr1 | ||
$sgpr6_sgpr7 = COPY $agpr0_agpr1 | ||
|
||
S_ENDPGM 0 | ||
... |
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.
Uh oh!
There was an error while loading. Please reload this page.