mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-09 13:33:17 +00:00
Have the PBQP register allocator use the subtarget on the MachineFunction.
(and remove an extraneous private). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227181 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
556614bf09
commit
05935e2d04
@ -170,8 +170,6 @@ public:
|
|||||||
|
|
||||||
/// @brief Add interference edges between overlapping vregs.
|
/// @brief Add interference edges between overlapping vregs.
|
||||||
class Interference : public PBQPRAConstraint {
|
class Interference : public PBQPRAConstraint {
|
||||||
private:
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
typedef const PBQP::RegAlloc::AllowedRegVector* AllowedRegVecPtr;
|
typedef const PBQP::RegAlloc::AllowedRegVector* AllowedRegVecPtr;
|
||||||
@ -308,7 +306,7 @@ private:
|
|||||||
PBQPRAGraph::NodeId MId, IMatrixCache &C) {
|
PBQPRAGraph::NodeId MId, IMatrixCache &C) {
|
||||||
|
|
||||||
const TargetRegisterInfo &TRI =
|
const TargetRegisterInfo &TRI =
|
||||||
*G.getMetadata().MF.getTarget().getSubtargetImpl()->getRegisterInfo();
|
*G.getMetadata().MF.getSubtarget().getRegisterInfo();
|
||||||
|
|
||||||
const auto &NRegs = G.getNodeMetadata(NId).getAllowedRegs();
|
const auto &NRegs = G.getNodeMetadata(NId).getAllowedRegs();
|
||||||
const auto &MRegs = G.getNodeMetadata(MId).getAllowedRegs();
|
const auto &MRegs = G.getNodeMetadata(MId).getAllowedRegs();
|
||||||
@ -342,7 +340,7 @@ public:
|
|||||||
void apply(PBQPRAGraph &G) override {
|
void apply(PBQPRAGraph &G) override {
|
||||||
MachineFunction &MF = G.getMetadata().MF;
|
MachineFunction &MF = G.getMetadata().MF;
|
||||||
MachineBlockFrequencyInfo &MBFI = G.getMetadata().MBFI;
|
MachineBlockFrequencyInfo &MBFI = G.getMetadata().MBFI;
|
||||||
CoalescerPair CP(*MF.getTarget().getSubtargetImpl()->getRegisterInfo());
|
CoalescerPair CP(*MF.getSubtarget().getRegisterInfo());
|
||||||
|
|
||||||
// Scan the machine function and add a coalescing cost whenever CoalescerPair
|
// Scan the machine function and add a coalescing cost whenever CoalescerPair
|
||||||
// gives the Ok.
|
// gives the Ok.
|
||||||
@ -494,7 +492,7 @@ void RegAllocPBQP::initializeGraph(PBQPRAGraph &G) {
|
|||||||
LiveIntervals &LIS = G.getMetadata().LIS;
|
LiveIntervals &LIS = G.getMetadata().LIS;
|
||||||
const MachineRegisterInfo &MRI = G.getMetadata().MF.getRegInfo();
|
const MachineRegisterInfo &MRI = G.getMetadata().MF.getRegInfo();
|
||||||
const TargetRegisterInfo &TRI =
|
const TargetRegisterInfo &TRI =
|
||||||
*G.getMetadata().MF.getTarget().getSubtargetImpl()->getRegisterInfo();
|
*G.getMetadata().MF.getSubtarget().getRegisterInfo();
|
||||||
|
|
||||||
for (auto VReg : VRegsToAlloc) {
|
for (auto VReg : VRegsToAlloc) {
|
||||||
const TargetRegisterClass *TRC = MRI.getRegClass(VReg);
|
const TargetRegisterClass *TRC = MRI.getRegClass(VReg);
|
||||||
@ -553,8 +551,7 @@ bool RegAllocPBQP::mapPBQPToRegAlloc(const PBQPRAGraph &G,
|
|||||||
Spiller &VRegSpiller) {
|
Spiller &VRegSpiller) {
|
||||||
MachineFunction &MF = G.getMetadata().MF;
|
MachineFunction &MF = G.getMetadata().MF;
|
||||||
LiveIntervals &LIS = G.getMetadata().LIS;
|
LiveIntervals &LIS = G.getMetadata().LIS;
|
||||||
const TargetRegisterInfo &TRI =
|
const TargetRegisterInfo &TRI = *MF.getSubtarget().getRegisterInfo();
|
||||||
*MF.getTarget().getSubtargetImpl()->getRegisterInfo();
|
|
||||||
(void)TRI;
|
(void)TRI;
|
||||||
|
|
||||||
// Set to true if we have any spills
|
// Set to true if we have any spills
|
||||||
@ -670,7 +667,7 @@ bool RegAllocPBQP::runOnMachineFunction(MachineFunction &MF) {
|
|||||||
// If there are non-empty intervals allocate them using pbqp.
|
// If there are non-empty intervals allocate them using pbqp.
|
||||||
if (!VRegsToAlloc.empty()) {
|
if (!VRegsToAlloc.empty()) {
|
||||||
|
|
||||||
const TargetSubtargetInfo &Subtarget = *MF.getTarget().getSubtargetImpl();
|
const TargetSubtargetInfo &Subtarget = MF.getSubtarget();
|
||||||
std::unique_ptr<PBQPRAConstraintList> ConstraintsRoot =
|
std::unique_ptr<PBQPRAConstraintList> ConstraintsRoot =
|
||||||
llvm::make_unique<PBQPRAConstraintList>();
|
llvm::make_unique<PBQPRAConstraintList>();
|
||||||
ConstraintsRoot->addConstraint(llvm::make_unique<SpillCosts>());
|
ConstraintsRoot->addConstraint(llvm::make_unique<SpillCosts>());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user