-
Notifications
You must be signed in to change notification settings - Fork 15.3k
[AMDGPU][NewPM] Port SIFixVGPRCopies to NPM #123592
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 1 commit
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 |
|---|---|---|
|
|
@@ -11,6 +11,7 @@ | |
| /// | ||
| //===----------------------------------------------------------------------===// | ||
|
|
||
| #include "SIFixVGPRCopies.h" | ||
optimisan marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| #include "AMDGPU.h" | ||
| #include "GCNSubtarget.h" | ||
| #include "MCTargetDesc/AMDGPUMCTargetDesc.h" | ||
|
|
@@ -22,13 +23,12 @@ using namespace llvm; | |
|
|
||
| namespace { | ||
|
|
||
| class SIFixVGPRCopies : public MachineFunctionPass { | ||
| class SIFixVGPRCopiesLegacy : public MachineFunctionPass { | ||
| public: | ||
| static char ID; | ||
|
|
||
| public: | ||
| SIFixVGPRCopies() : MachineFunctionPass(ID) { | ||
| initializeSIFixVGPRCopiesPass(*PassRegistry::getPassRegistry()); | ||
| SIFixVGPRCopiesLegacy() : MachineFunctionPass(ID) { | ||
| initializeSIFixVGPRCopiesLegacyPass(*PassRegistry::getPassRegistry()); | ||
| } | ||
|
|
||
| void getAnalysisUsage(AnalysisUsage &AU) const override { | ||
|
|
@@ -41,15 +41,31 @@ class SIFixVGPRCopies : public MachineFunctionPass { | |
| StringRef getPassName() const override { return "SI Fix VGPR copies"; } | ||
| }; | ||
|
|
||
| class SIFixVGPRCopies { | ||
| public: | ||
| bool run(MachineFunction &MF); | ||
| }; | ||
|
|
||
| } // End anonymous namespace. | ||
|
|
||
| INITIALIZE_PASS(SIFixVGPRCopies, DEBUG_TYPE, "SI Fix VGPR copies", false, false) | ||
| INITIALIZE_PASS(SIFixVGPRCopiesLegacy, DEBUG_TYPE, "SI Fix VGPR copies", false, | ||
| false) | ||
|
|
||
| char SIFixVGPRCopies::ID = 0; | ||
| char SIFixVGPRCopiesLegacy::ID = 0; | ||
|
|
||
| char &llvm::SIFixVGPRCopiesID = SIFixVGPRCopies::ID; | ||
| char &llvm::SIFixVGPRCopiesID = SIFixVGPRCopiesLegacy::ID; | ||
|
|
||
| PreservedAnalyses SIFixVGPRCopiesPass::run(MachineFunction &MF, | ||
| MachineFunctionAnalysisManager &) { | ||
| SIFixVGPRCopies().run(MF); | ||
| return PreservedAnalyses::all(); | ||
|
Contributor
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. Why is it OK to return
Contributor
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. the legacy one does setPreservesAll, so this is just replicating that
Contributor
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. Ack. ( |
||
| } | ||
|
|
||
| bool SIFixVGPRCopiesLegacy::runOnMachineFunction(MachineFunction &MF) { | ||
| return SIFixVGPRCopies().run(MF); | ||
| } | ||
|
|
||
| bool SIFixVGPRCopies::runOnMachineFunction(MachineFunction &MF) { | ||
| bool SIFixVGPRCopies::run(MachineFunction &MF) { | ||
| const GCNSubtarget &ST = MF.getSubtarget<GCNSubtarget>(); | ||
| const SIRegisterInfo *TRI = ST.getRegisterInfo(); | ||
| const SIInstrInfo *TII = ST.getInstrInfo(); | ||
|
|
||
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.
Unrelated to this patch. This option is placed wrongly. Should have a post patch to sink it down.