CodeGen: BlockPlacement: Add comment about DenseMap Safety.

The use of a DenseMap in precomputeTriangleChains does not cause
non-determinism, even though it is iterated over, as the only thing the
iteration does is to insert entries into a new DenseMap, which is not iterated.
Comment only change.

llvm-svn: 300088
This commit is contained in:
Kyle Butt 2017-04-12 18:30:32 +00:00
parent 5c5bc7bc0a
commit 336c78fdbe
1 changed files with 3 additions and 0 deletions

View File

@ -1165,6 +1165,9 @@ void MachineBlockPlacement::precomputeTriangleChains() {
}
}
// Iterating over a DenseMap is safe here, because the only thing in the body
// of the loop is inserting into another DenseMap (ComputedEdges).
// ComputedEdges is never iterated, so this doesn't lead to non-determinism.
for (auto &ChainPair : TriangleChainMap) {
TriangleChain &Chain = ChainPair.second;
// Benchmarking has shown that due to branch correlation duplicating 2 or