diff options
author | Cameron Zwarich <zwarich@apple.com> | 2011-01-04 06:42:27 +0000 |
---|---|---|
committer | Cameron Zwarich <zwarich@apple.com> | 2011-01-04 06:42:27 +0000 |
commit | 82e8332a222d98a572b9cc685a4aeed9a3e591aa (patch) | |
tree | c96d4984656d64ded65af5ab9235c19b43d7b39f | |
parent | a92409c3ec845ed39459d5d6f93e9d328fe477d4 (diff) | |
download | bcm5719-llvm-82e8332a222d98a572b9cc685a4aeed9a3e591aa.tar.gz bcm5719-llvm-82e8332a222d98a572b9cc685a4aeed9a3e591aa.zip |
Eliminate repeated allocation of a per-BB DenseMap for a 4.6% reduction of time
spent in StrongPHIElimination on 403.gcc.
llvm-svn: 122803
-rw-r--r-- | llvm/lib/CodeGen/StrongPHIElimination.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/llvm/lib/CodeGen/StrongPHIElimination.cpp b/llvm/lib/CodeGen/StrongPHIElimination.cpp index 91ec13df643..54c6647f059 100644 --- a/llvm/lib/CodeGen/StrongPHIElimination.cpp +++ b/llvm/lib/CodeGen/StrongPHIElimination.cpp @@ -144,6 +144,10 @@ namespace { // sources. DenseMap<MachineBasicBlock*, std::vector<MachineInstr*> > PHISrcDefs; + // Maps a color to a pair of a MachineInstr* and a virtual register, which + // is the operand of that PHI corresponding to the current basic block. + DenseMap<unsigned, std::pair<MachineInstr*, unsigned> > CurrentPHIForColor; + // FIXME: Can these two data structures be combined? Would a std::multimap // be any better? @@ -567,12 +571,7 @@ StrongPHIElimination::SplitInterferencesForBasicBlock( // the predecessor block. The def of a PHI's destination register is processed // along with the other defs in a basic block. - // The map CurrentPHIForColor maps a color to a pair of a MachineInstr* and a - // virtual register, which is the operand of that PHI corresponding to the - // current basic block. - // FIXME: This should use a container that doesn't always perform heap - // allocation. - DenseMap<unsigned, std::pair<MachineInstr*, unsigned> > CurrentPHIForColor; + CurrentPHIForColor.clear(); for (MachineBasicBlock::succ_iterator SI = MBB.succ_begin(), SE = MBB.succ_end(); SI != SE; ++SI) { |