mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-30 19:35:54 +00:00
Explain why DenseMap is still used here instead of MapVector.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166454 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
2128aaebd8
commit
6ecdd0e824
@ -212,7 +212,11 @@ namespace {
|
||||
///
|
||||
DenseMap<AllocaInst*, unsigned> AllocaLookup;
|
||||
|
||||
/// NewPhiNodes - The PhiNodes we're adding.
|
||||
/// NewPhiNodes - The PhiNodes we're adding. That map is used to simplify
|
||||
/// some Phi nodes as we iterate over it, so it should have deterministic
|
||||
/// iterators. We could use a MapVector, but since we already maintain a
|
||||
/// map from BasicBlock* to a stable numbering (BBNumbers), the DenseMap is
|
||||
/// more efficient (also supports removal).
|
||||
///
|
||||
DenseMap<std::pair<unsigned, unsigned>, PHINode*> NewPhiNodes;
|
||||
|
||||
@ -588,6 +592,10 @@ void PromoteMem2Reg::run() {
|
||||
while (EliminatedAPHI) {
|
||||
EliminatedAPHI = false;
|
||||
|
||||
// Iterating over NewPhiNodes is deterministic, so it is safe to try to
|
||||
// simplify and RUAW them as we go. If it was not, we could add uses to
|
||||
// the values we replace with in a non deterministic order, thus creating
|
||||
// non deterministic def->use chains.
|
||||
for (DenseMap<std::pair<unsigned, unsigned>, PHINode*>::iterator I =
|
||||
NewPhiNodes.begin(), E = NewPhiNodes.end(); I != E;) {
|
||||
PHINode *PN = I->second;
|
||||
|
Loading…
x
Reference in New Issue
Block a user