mirror of
https://github.com/RPCSX/llvm.git
synced 2024-11-28 06:00:28 +00:00
MachineCopyPropagation: Introduce Reg2MIMap typedef; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261408 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
4f08db2396
commit
3883deb9ef
@ -48,6 +48,7 @@ namespace {
|
||||
private:
|
||||
typedef SmallVector<unsigned, 4> DestList;
|
||||
typedef DenseMap<unsigned, DestList> SourceMap;
|
||||
typedef DenseMap<unsigned, MachineInstr*> Reg2MIMap;
|
||||
|
||||
void SourceNoLongerAvailable(unsigned Reg);
|
||||
void CopyPropagateBlock(MachineBasicBlock &MBB);
|
||||
@ -55,9 +56,9 @@ namespace {
|
||||
/// Candidates for deletion.
|
||||
SmallSetVector<MachineInstr*, 8> MaybeDeadCopies;
|
||||
/// Def -> available copies map.
|
||||
DenseMap<unsigned, MachineInstr*> AvailCopyMap;
|
||||
Reg2MIMap AvailCopyMap;
|
||||
/// Def -> copies map.
|
||||
DenseMap<unsigned, MachineInstr*> CopyMap;
|
||||
Reg2MIMap CopyMap;
|
||||
/// Src -> Def map
|
||||
SourceMap SrcMap;
|
||||
bool Changed;
|
||||
@ -176,7 +177,7 @@ void MachineCopyPropagation::CopyPropagateBlock(MachineBasicBlock &MBB) {
|
||||
// If Src is defined by a previous copy, the previous copy cannot be
|
||||
// eliminated.
|
||||
for (MCRegAliasIterator AI(Src, TRI, true); AI.isValid(); ++AI) {
|
||||
CI = CopyMap.find(*AI);
|
||||
Reg2MIMap::iterator CI = CopyMap.find(*AI);
|
||||
if (CI != CopyMap.end()) {
|
||||
DEBUG(dbgs() << "MCP: Copy is no longer dead: "; CI->second->dump());
|
||||
MaybeDeadCopies.remove(CI->second);
|
||||
@ -242,7 +243,7 @@ void MachineCopyPropagation::CopyPropagateBlock(MachineBasicBlock &MBB) {
|
||||
// If 'Reg' is defined by a copy, the copy is no longer a candidate
|
||||
// for elimination.
|
||||
for (MCRegAliasIterator AI(Reg, TRI, true); AI.isValid(); ++AI) {
|
||||
DenseMap<unsigned, MachineInstr*>::iterator CI = CopyMap.find(*AI);
|
||||
Reg2MIMap::iterator CI = CopyMap.find(*AI);
|
||||
if (CI != CopyMap.end()) {
|
||||
DEBUG(dbgs() << "MCP: Copy is used - not dead: "; CI->second->dump());
|
||||
MaybeDeadCopies.remove(CI->second);
|
||||
|
Loading…
Reference in New Issue
Block a user