[llvm] r261408 - MachineCopyPropagation: Introduce Reg2MIMap typedef; NFC
Matthias Braun via llvm-commits
llvm-commits at lists.llvm.org
Fri Feb 19 19:56:41 PST 2016
Author: matze
Date: Fri Feb 19 21:56:41 2016
New Revision: 261408
URL: http://llvm.org/viewvc/llvm-project?rev=261408&view=rev
Log:
MachineCopyPropagation: Introduce Reg2MIMap typedef; NFC
Modified:
llvm/trunk/lib/CodeGen/MachineCopyPropagation.cpp
Modified: llvm/trunk/lib/CodeGen/MachineCopyPropagation.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineCopyPropagation.cpp?rev=261408&r1=261407&r2=261408&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/MachineCopyPropagation.cpp (original)
+++ llvm/trunk/lib/CodeGen/MachineCopyPropagation.cpp Fri Feb 19 21:56:41 2016
@@ -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::CopyPropaga
// 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::CopyPropaga
// 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);
More information about the llvm-commits
mailing list