diff options
author | Kyle Butt <kyle+llvm@iteratee.net> | 2017-04-12 18:30:32 +0000 |
---|---|---|
committer | Kyle Butt <kyle+llvm@iteratee.net> | 2017-04-12 18:30:32 +0000 |
commit | 336c78fdbe61270baca0f9fe72e3dc87375fa84e (patch) | |
tree | 1a3c35ad6d3d3e0ae3a0af3c9cbd560209b3960a /llvm/lib/CodeGen/MachineBlockPlacement.cpp | |
parent | 5c5bc7bc0a98e2ed3e9db318a2465dfd781a9435 (diff) | |
download | bcm5719-llvm-336c78fdbe61270baca0f9fe72e3dc87375fa84e.tar.gz bcm5719-llvm-336c78fdbe61270baca0f9fe72e3dc87375fa84e.zip |
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
Diffstat (limited to 'llvm/lib/CodeGen/MachineBlockPlacement.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MachineBlockPlacement.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/MachineBlockPlacement.cpp b/llvm/lib/CodeGen/MachineBlockPlacement.cpp index e23f90be409..4cfc128a8c1 100644 --- a/llvm/lib/CodeGen/MachineBlockPlacement.cpp +++ b/llvm/lib/CodeGen/MachineBlockPlacement.cpp @@ -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 |