mirror of
https://github.com/RPCSX/llvm.git
synced 2025-02-01 10:02:42 +00:00
Use a new local data structure instead of the MachineInstr::regsUsed set
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7621 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
c393c57afc
commit
3fd1f5bb6a
@ -1059,7 +1059,7 @@ int PhyRegAlloc::getUsableUniRegAtMI(const int RegType,
|
|||||||
// of copying it to memory and back. But we have to mark the
|
// of copying it to memory and back. But we have to mark the
|
||||||
// register as used by this instruction, so it does not get used
|
// register as used by this instruction, so it does not get used
|
||||||
// as a scratch reg. by another operand or anyone else.
|
// as a scratch reg. by another operand or anyone else.
|
||||||
MInst->insertUsedReg(scratchReg);
|
ScratchRegsUsed.insert(std::make_pair(MInst, scratchReg));
|
||||||
MRI.cpReg2RegMI(MIBef, RegU, scratchReg, RegType);
|
MRI.cpReg2RegMI(MIBef, RegU, scratchReg, RegType);
|
||||||
MRI.cpReg2RegMI(MIAft, scratchReg, RegU, RegType);
|
MRI.cpReg2RegMI(MIAft, scratchReg, RegU, RegType);
|
||||||
}
|
}
|
||||||
@ -1175,13 +1175,12 @@ void PhyRegAlloc::setRelRegsUsedByThisInst(RegClass *RC, int RegType,
|
|||||||
markRegisterUsed(MI->getImplicitOp(i).getAllocatedRegNum(), RC,
|
markRegisterUsed(MI->getImplicitOp(i).getAllocatedRegNum(), RC,
|
||||||
RegType,MRI);
|
RegType,MRI);
|
||||||
|
|
||||||
// The getRegsUsed() method returns the set of scratch registers that are used
|
// Add all of the scratch registers that are used to save values across the
|
||||||
// to save values across the instruction (e.g., for saving state register
|
// instruction (e.g., for saving state register values).
|
||||||
// values).
|
std::pair<ScratchRegsUsedTy::iterator, ScratchRegsUsedTy::iterator>
|
||||||
const std::set<int> ®sUsed = MI->getRegsUsed();
|
IR = ScratchRegsUsed.equal_range(MI);
|
||||||
for (std::set<int>::iterator I = regsUsed.begin(),
|
for (ScratchRegsUsedTy::iterator I = IR.first; I != IR.second; ++I)
|
||||||
E = regsUsed.end(); I != E; ++I)
|
markRegisterUsed(I->second, RC, RegType, MRI);
|
||||||
markRegisterUsed(*I, RC, RegType, MRI);
|
|
||||||
|
|
||||||
// If there are implicit references, mark their allocated regs as well
|
// If there are implicit references, mark their allocated regs as well
|
||||||
//
|
//
|
||||||
|
@ -1059,7 +1059,7 @@ int PhyRegAlloc::getUsableUniRegAtMI(const int RegType,
|
|||||||
// of copying it to memory and back. But we have to mark the
|
// of copying it to memory and back. But we have to mark the
|
||||||
// register as used by this instruction, so it does not get used
|
// register as used by this instruction, so it does not get used
|
||||||
// as a scratch reg. by another operand or anyone else.
|
// as a scratch reg. by another operand or anyone else.
|
||||||
MInst->insertUsedReg(scratchReg);
|
ScratchRegsUsed.insert(std::make_pair(MInst, scratchReg));
|
||||||
MRI.cpReg2RegMI(MIBef, RegU, scratchReg, RegType);
|
MRI.cpReg2RegMI(MIBef, RegU, scratchReg, RegType);
|
||||||
MRI.cpReg2RegMI(MIAft, scratchReg, RegU, RegType);
|
MRI.cpReg2RegMI(MIAft, scratchReg, RegU, RegType);
|
||||||
}
|
}
|
||||||
@ -1175,13 +1175,12 @@ void PhyRegAlloc::setRelRegsUsedByThisInst(RegClass *RC, int RegType,
|
|||||||
markRegisterUsed(MI->getImplicitOp(i).getAllocatedRegNum(), RC,
|
markRegisterUsed(MI->getImplicitOp(i).getAllocatedRegNum(), RC,
|
||||||
RegType,MRI);
|
RegType,MRI);
|
||||||
|
|
||||||
// The getRegsUsed() method returns the set of scratch registers that are used
|
// Add all of the scratch registers that are used to save values across the
|
||||||
// to save values across the instruction (e.g., for saving state register
|
// instruction (e.g., for saving state register values).
|
||||||
// values).
|
std::pair<ScratchRegsUsedTy::iterator, ScratchRegsUsedTy::iterator>
|
||||||
const std::set<int> ®sUsed = MI->getRegsUsed();
|
IR = ScratchRegsUsed.equal_range(MI);
|
||||||
for (std::set<int>::iterator I = regsUsed.begin(),
|
for (ScratchRegsUsedTy::iterator I = IR.first; I != IR.second; ++I)
|
||||||
E = regsUsed.end(); I != E; ++I)
|
markRegisterUsed(I->second, RC, RegType, MRI);
|
||||||
markRegisterUsed(*I, RC, RegType, MRI);
|
|
||||||
|
|
||||||
// If there are implicit references, mark their allocated regs as well
|
// If there are implicit references, mark their allocated regs as well
|
||||||
//
|
//
|
||||||
|
Loading…
x
Reference in New Issue
Block a user