[MachineBlockPlacment] Add an assert to ensure there is no order dependency on DenseMap iteration order.

llvm-svn: 300060
This commit is contained in:
Benjamin Kramer 2017-04-12 13:26:31 +00:00
parent d71461c209
commit 33580692f6
1 changed files with 7 additions and 3 deletions

View File

@ -1160,8 +1160,8 @@ void MachineBlockPlacement::precomputeTriangleChains() {
TriangleChainMap.insert(std::make_pair(Chain.getKey(), std::move(Chain)));
} else {
auto InsertResult = TriangleChainMap.try_emplace(PDom, &BB, PDom);
assert (InsertResult.second && "Block seen twice.");
(void) InsertResult;
assert(InsertResult.second && "Block seen twice.");
(void)InsertResult;
}
}
@ -1177,7 +1177,11 @@ void MachineBlockPlacement::precomputeTriangleChains() {
for (MachineBasicBlock *src : reverse(Chain.Edges)) {
DEBUG(dbgs() << "Marking edge: " << getBlockName(src) << "->" <<
getBlockName(dst) << " as pre-computed based on triangles.\n");
ComputedEdges[src] = { dst, true };
auto InsertResult = ComputedEdges.insert({src, {dst, true}});
assert(InsertResult.second && "Block seen twice.");
(void)InsertResult;
dst = src;
}
}