Skip to content

Commit 0d08e55

Browse files
committed
Move RequiredAnalyses and correct preserved analyses
1 parent 7ea196d commit 0d08e55

File tree

2 files changed

+25
-24
lines changed

2 files changed

+25
-24
lines changed

llvm/lib/CodeGen/RegAllocGreedy.cpp

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,30 @@ RAGreedyLegacy::RAGreedyLegacy(const RegAllocFilterFunc F)
183183
initializeRAGreedyLegacyPass(*PassRegistry::getPassRegistry());
184184
}
185185

186+
struct RAGreedy::RequiredAnalyses {
187+
VirtRegMap *VRM = nullptr;
188+
LiveIntervals *LIS = nullptr;
189+
LiveRegMatrix *LRM = nullptr;
190+
SlotIndexes *Indexes = nullptr;
191+
MachineBlockFrequencyInfo *MBFI = nullptr;
192+
MachineDominatorTree *DomTree = nullptr;
193+
MachineLoopInfo *Loops = nullptr;
194+
MachineOptimizationRemarkEmitter *ORE = nullptr;
195+
EdgeBundles *Bundles = nullptr;
196+
SpillPlacement *SpillPlacer = nullptr;
197+
LiveDebugVariables *DebugVars = nullptr;
198+
199+
// Used by InlineSpiller
200+
LiveStacks *LSS;
201+
// Proxies for eviction and priority advisors
202+
RegAllocEvictionAdvisorProvider *EvictProvider;
203+
RegAllocPriorityAdvisorProvider *PriorityProvider;
204+
205+
RequiredAnalyses() {}
206+
RequiredAnalyses(Pass &P);
207+
RequiredAnalyses(MachineFunction &MF, MachineFunctionAnalysisManager &MFAM);
208+
};
209+
186210
RAGreedy::RAGreedy(RequiredAnalyses &Analyses, const RegAllocFilterFunc F)
187211
: RegAllocBase(F) {
188212
VRM = Analyses.VRM;

llvm/lib/CodeGen/RegAllocGreedy.h

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
#include "llvm/CodeGen/SpillPlacement.h"
3434
#include "llvm/CodeGen/Spiller.h"
3535
#include "llvm/CodeGen/TargetRegisterInfo.h"
36-
#include "llvm/IR/PassManager.h"
3736
#include <algorithm>
3837
#include <cstdint>
3938
#include <memory>
@@ -61,29 +60,7 @@ class VirtRegMap;
6160
class LLVM_LIBRARY_VISIBILITY RAGreedy : public RegAllocBase,
6261
private LiveRangeEdit::Delegate {
6362
public:
64-
struct RequiredAnalyses {
65-
VirtRegMap *VRM = nullptr;
66-
LiveIntervals *LIS = nullptr;
67-
LiveRegMatrix *LRM = nullptr;
68-
SlotIndexes *Indexes = nullptr;
69-
MachineBlockFrequencyInfo *MBFI = nullptr;
70-
MachineDominatorTree *DomTree = nullptr;
71-
MachineLoopInfo *Loops = nullptr;
72-
MachineOptimizationRemarkEmitter *ORE = nullptr;
73-
EdgeBundles *Bundles = nullptr;
74-
SpillPlacement *SpillPlacer = nullptr;
75-
LiveDebugVariables *DebugVars = nullptr;
76-
77-
// Used by InlineSpiller
78-
LiveStacks *LSS;
79-
// Proxies for eviction and priority advisors
80-
RegAllocEvictionAdvisorProvider *EvictProvider;
81-
RegAllocPriorityAdvisorProvider *PriorityProvider;
82-
83-
RequiredAnalyses() {}
84-
RequiredAnalyses(Pass &P);
85-
RequiredAnalyses(MachineFunction &MF, MachineFunctionAnalysisManager &MFAM);
86-
};
63+
struct RequiredAnalyses;
8764

8865
// Interface to eviction advisers
8966
/// Track allocation stage and eviction loop prevention during allocation.

0 commit comments

Comments
 (0)