1111// /
1212// ===----------------------------------------------------------------------===//
1313
14+ #include " SIFixVGPRCopies.h"
1415#include " AMDGPU.h"
1516#include " GCNSubtarget.h"
1617#include " MCTargetDesc/AMDGPUMCTargetDesc.h"
@@ -22,13 +23,12 @@ using namespace llvm;
2223
2324namespace {
2425
25- class SIFixVGPRCopies : public MachineFunctionPass {
26+ class SIFixVGPRCopiesLegacy : public MachineFunctionPass {
2627public:
2728 static char ID;
2829
29- public:
30- SIFixVGPRCopies () : MachineFunctionPass(ID) {
31- initializeSIFixVGPRCopiesPass (*PassRegistry::getPassRegistry ());
30+ SIFixVGPRCopiesLegacy () : MachineFunctionPass(ID) {
31+ initializeSIFixVGPRCopiesLegacyPass (*PassRegistry::getPassRegistry ());
3232 }
3333
3434 void getAnalysisUsage (AnalysisUsage &AU) const override {
@@ -41,15 +41,31 @@ class SIFixVGPRCopies : public MachineFunctionPass {
4141 StringRef getPassName () const override { return " SI Fix VGPR copies" ; }
4242};
4343
44+ class SIFixVGPRCopies {
45+ public:
46+ bool run (MachineFunction &MF);
47+ };
48+
4449} // End anonymous namespace.
4550
46- INITIALIZE_PASS (SIFixVGPRCopies, DEBUG_TYPE, " SI Fix VGPR copies" , false , false )
51+ INITIALIZE_PASS (SIFixVGPRCopiesLegacy, DEBUG_TYPE, " SI Fix VGPR copies" , false ,
52+ false )
4753
48- char SIFixVGPRCopies ::ID = 0;
54+ char SIFixVGPRCopiesLegacy ::ID = 0;
4955
50- char &llvm::SIFixVGPRCopiesID = SIFixVGPRCopies::ID;
56+ char &llvm::SIFixVGPRCopiesID = SIFixVGPRCopiesLegacy::ID;
57+
58+ PreservedAnalyses SIFixVGPRCopiesPass::run (MachineFunction &MF,
59+ MachineFunctionAnalysisManager &) {
60+ SIFixVGPRCopies ().run (MF);
61+ return PreservedAnalyses::all ();
62+ }
63+
64+ bool SIFixVGPRCopiesLegacy::runOnMachineFunction (MachineFunction &MF) {
65+ return SIFixVGPRCopies ().run (MF);
66+ }
5167
52- bool SIFixVGPRCopies::runOnMachineFunction (MachineFunction &MF) {
68+ bool SIFixVGPRCopies::run (MachineFunction &MF) {
5369 const GCNSubtarget &ST = MF.getSubtarget <GCNSubtarget>();
5470 const SIRegisterInfo *TRI = ST.getRegisterInfo ();
5571 const SIInstrInfo *TII = ST.getInstrInfo ();
0 commit comments