mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-27 00:21:03 +00:00
Extract two methods. No functional change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144020 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -149,6 +149,8 @@ private:
|
|||||||
bool Merge(DomainValue *A, DomainValue *B);
|
bool Merge(DomainValue *A, DomainValue *B);
|
||||||
|
|
||||||
void enterBasicBlock(MachineBasicBlock*);
|
void enterBasicBlock(MachineBasicBlock*);
|
||||||
|
void leaveBasicBlock(MachineBasicBlock*);
|
||||||
|
void visitInstr(MachineInstr*);
|
||||||
void visitGenericInstr(MachineInstr*);
|
void visitGenericInstr(MachineInstr*);
|
||||||
void visitSoftInstr(MachineInstr*, unsigned mask);
|
void visitSoftInstr(MachineInstr*, unsigned mask);
|
||||||
void visitHardInstr(MachineInstr*, unsigned domain);
|
void visitHardInstr(MachineInstr*, unsigned domain);
|
||||||
@@ -305,6 +307,27 @@ void ExeDepsFix::enterBasicBlock(MachineBasicBlock *MBB) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ExeDepsFix::leaveBasicBlock(MachineBasicBlock *MBB) {
|
||||||
|
// Save live registers at end of MBB - used by enterBasicBlock().
|
||||||
|
if (LiveRegs)
|
||||||
|
LiveOuts.insert(std::make_pair(MBB, LiveRegs));
|
||||||
|
LiveRegs = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void ExeDepsFix::visitInstr(MachineInstr *MI) {
|
||||||
|
if (MI->isDebugValue())
|
||||||
|
return;
|
||||||
|
++Distance;
|
||||||
|
std::pair<uint16_t, uint16_t> domp = TII->getExecutionDomain(MI);
|
||||||
|
if (domp.first)
|
||||||
|
if (domp.second)
|
||||||
|
visitSoftInstr(MI, domp.second);
|
||||||
|
else
|
||||||
|
visitHardInstr(MI, domp.first);
|
||||||
|
else if (LiveRegs)
|
||||||
|
visitGenericInstr(MI);
|
||||||
|
}
|
||||||
|
|
||||||
// A hard instruction only works in one domain. All input registers will be
|
// A hard instruction only works in one domain. All input registers will be
|
||||||
// forced into that domain.
|
// forced into that domain.
|
||||||
void ExeDepsFix::visitHardInstr(MachineInstr *mi, unsigned domain) {
|
void ExeDepsFix::visitHardInstr(MachineInstr *mi, unsigned domain) {
|
||||||
@@ -483,24 +506,9 @@ bool ExeDepsFix::runOnMachineFunction(MachineFunction &mf) {
|
|||||||
MachineBasicBlock *MBB = *DFI;
|
MachineBasicBlock *MBB = *DFI;
|
||||||
enterBasicBlock(MBB);
|
enterBasicBlock(MBB);
|
||||||
for (MachineBasicBlock::iterator I = MBB->begin(), E = MBB->end(); I != E;
|
for (MachineBasicBlock::iterator I = MBB->begin(), E = MBB->end(); I != E;
|
||||||
++I) {
|
++I)
|
||||||
MachineInstr *mi = I;
|
visitInstr(I);
|
||||||
if (mi->isDebugValue()) continue;
|
leaveBasicBlock(MBB);
|
||||||
++Distance;
|
|
||||||
std::pair<uint16_t, uint16_t> domp = TII->getExecutionDomain(mi);
|
|
||||||
if (domp.first)
|
|
||||||
if (domp.second)
|
|
||||||
visitSoftInstr(mi, domp.second);
|
|
||||||
else
|
|
||||||
visitHardInstr(mi, domp.first);
|
|
||||||
else if (LiveRegs)
|
|
||||||
visitGenericInstr(mi);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Save live registers at end of MBB - used by enterBasicBlock().
|
|
||||||
if (LiveRegs)
|
|
||||||
LiveOuts.insert(std::make_pair(MBB, LiveRegs));
|
|
||||||
LiveRegs = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Clear the LiveOuts vectors. Should we also collapse any remaining
|
// Clear the LiveOuts vectors. Should we also collapse any remaining
|
||||||
|
Reference in New Issue
Block a user