mirror of
https://github.com/RPCSX/llvm.git
synced 2025-02-25 23:45:36 +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:
|
private:
|
||||||
typedef SmallVector<unsigned, 4> DestList;
|
typedef SmallVector<unsigned, 4> DestList;
|
||||||
typedef DenseMap<unsigned, DestList> SourceMap;
|
typedef DenseMap<unsigned, DestList> SourceMap;
|
||||||
|
typedef DenseMap<unsigned, MachineInstr*> Reg2MIMap;
|
||||||
|
|
||||||
void SourceNoLongerAvailable(unsigned Reg);
|
void SourceNoLongerAvailable(unsigned Reg);
|
||||||
void CopyPropagateBlock(MachineBasicBlock &MBB);
|
void CopyPropagateBlock(MachineBasicBlock &MBB);
|
||||||
@ -55,9 +56,9 @@ namespace {
|
|||||||
/// Candidates for deletion.
|
/// Candidates for deletion.
|
||||||
SmallSetVector<MachineInstr*, 8> MaybeDeadCopies;
|
SmallSetVector<MachineInstr*, 8> MaybeDeadCopies;
|
||||||
/// Def -> available copies map.
|
/// Def -> available copies map.
|
||||||
DenseMap<unsigned, MachineInstr*> AvailCopyMap;
|
Reg2MIMap AvailCopyMap;
|
||||||
/// Def -> copies map.
|
/// Def -> copies map.
|
||||||
DenseMap<unsigned, MachineInstr*> CopyMap;
|
Reg2MIMap CopyMap;
|
||||||
/// Src -> Def map
|
/// Src -> Def map
|
||||||
SourceMap SrcMap;
|
SourceMap SrcMap;
|
||||||
bool Changed;
|
bool Changed;
|
||||||
@ -176,7 +177,7 @@ void MachineCopyPropagation::CopyPropagateBlock(MachineBasicBlock &MBB) {
|
|||||||
// If Src is defined by a previous copy, the previous copy cannot be
|
// If Src is defined by a previous copy, the previous copy cannot be
|
||||||
// eliminated.
|
// eliminated.
|
||||||
for (MCRegAliasIterator AI(Src, TRI, true); AI.isValid(); ++AI) {
|
for (MCRegAliasIterator AI(Src, TRI, true); AI.isValid(); ++AI) {
|
||||||
CI = CopyMap.find(*AI);
|
Reg2MIMap::iterator CI = CopyMap.find(*AI);
|
||||||
if (CI != CopyMap.end()) {
|
if (CI != CopyMap.end()) {
|
||||||
DEBUG(dbgs() << "MCP: Copy is no longer dead: "; CI->second->dump());
|
DEBUG(dbgs() << "MCP: Copy is no longer dead: "; CI->second->dump());
|
||||||
MaybeDeadCopies.remove(CI->second);
|
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
|
// If 'Reg' is defined by a copy, the copy is no longer a candidate
|
||||||
// for elimination.
|
// for elimination.
|
||||||
for (MCRegAliasIterator AI(Reg, TRI, true); AI.isValid(); ++AI) {
|
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()) {
|
if (CI != CopyMap.end()) {
|
||||||
DEBUG(dbgs() << "MCP: Copy is used - not dead: "; CI->second->dump());
|
DEBUG(dbgs() << "MCP: Copy is used - not dead: "; CI->second->dump());
|
||||||
MaybeDeadCopies.remove(CI->second);
|
MaybeDeadCopies.remove(CI->second);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user