-
Notifications
You must be signed in to change notification settings - Fork 15.4k
[AMDGPU][NewPM] Port SILowerWWMCopies to NPM #123695
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 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
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
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,22 @@ | ||
| //===- SILowerWWMCopies.h ---------------------------------------*- C++- *-===// | ||
| // | ||
| // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
| // See https://llvm.org/LICENSE.txt for license information. | ||
| // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
| // | ||
| //===----------------------------------------------------------------------===// | ||
|
|
||
| #ifndef LLVM_LIB_TARGET_AMDGPU_SILOWERWWMCOPIES_H | ||
| #define LLVM_LIB_TARGET_AMDGPU_SILOWERWWMCOPIES_H | ||
|
|
||
| #include "llvm/CodeGen/MachinePassManager.h" | ||
|
|
||
| namespace llvm { | ||
| class SILowerWWMCopiesPass : public PassInfoMixin<SILowerWWMCopiesPass> { | ||
| public: | ||
| PreservedAnalyses run(MachineFunction &MF, | ||
| MachineFunctionAnalysisManager &MFAM); | ||
| }; | ||
| } // namespace llvm | ||
|
|
||
| #endif // LLVM_LIB_TARGET_AMDGPU_SILOWERWWMCOPIES_H |
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,43 @@ | ||
| # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py UTC_ARGS: --version 5 | ||
|
|
||
| # RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx900 -run-pass=liveintervals,virtregmap,si-lower-wwm-copies -o - %s | FileCheck %s | ||
| # RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx900 -passes="require<live-intervals>,require<virtregmap>,si-lower-wwm-copies" -o - %s | FileCheck %s | ||
|
|
||
| # Check for two cases of $scc being live and dead. | ||
| --- | ||
| name: lower-wwm-copies | ||
| registers: | ||
| - { id: 1, class: vgpr_32, flags: [ WWM_REG ]} | ||
| machineFunctionInfo: | ||
| sgprForEXECCopy: '$sgpr2_sgpr3' | ||
| tracksRegLiveness: true | ||
| body: | | ||
| ; CHECK-LABEL: name: lower-wwm-copies | ||
| ; CHECK: bb.0: | ||
| ; CHECK-NEXT: successors: %bb.1(0x80000000) | ||
| ; CHECK-NEXT: liveins: $vgpr0, $scc | ||
| ; CHECK-NEXT: {{ $}} | ||
| ; CHECK-NEXT: [[DEF:%[0-9]+]]:sgpr_32 = IMPLICIT_DEF | ||
| ; CHECK-NEXT: S_CMP_EQ_U32 [[DEF]], 0, implicit-def $scc | ||
| ; CHECK-NEXT: $sgpr2_sgpr3 = S_MOV_B64 killed $exec | ||
| ; CHECK-NEXT: $exec = S_MOV_B64 -1 | ||
| ; CHECK-NEXT: $vgpr1 = COPY $vgpr0 | ||
| ; CHECK-NEXT: $exec = S_MOV_B64 killed $sgpr2_sgpr3 | ||
| ; CHECK-NEXT: S_CBRANCH_SCC1 %bb.1, implicit $scc | ||
| ; CHECK-NEXT: {{ $}} | ||
| ; CHECK-NEXT: bb.1: | ||
| ; CHECK-NEXT: liveins: $vgpr1 | ||
| ; CHECK-NEXT: {{ $}} | ||
| ; CHECK-NEXT: $sgpr2_sgpr3 = S_OR_SAVEEXEC_B64 -1, implicit-def $exec, implicit-def dead $scc, implicit $exec | ||
| ; CHECK-NEXT: $vgpr2 = COPY $vgpr1 | ||
| ; CHECK-NEXT: $exec = S_MOV_B64 killed $sgpr2_sgpr3 | ||
| bb.0: | ||
| liveins: $vgpr0, $scc | ||
| %0:sgpr_32 = IMPLICIT_DEF | ||
| S_CMP_EQ_U32 %0, 0, implicit-def $scc | ||
| $vgpr1 = WWM_COPY $vgpr0 | ||
| S_CBRANCH_SCC1 %bb.1, implicit killed $scc | ||
|
|
||
| bb.1: | ||
| liveins: $vgpr1 | ||
| $vgpr2 = WWM_COPY $vgpr1 | ||
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.
I would have used a physreg for this operand. SGPR allocation is done by now as per the pass flow. It should still work with the SGPR virtual register though.
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.
Yes, sgpr should have been allocated at this point.