Skip to content

Commit

Permalink
[ExtractInstances] Fix nondeterminism with MapVector. (#4749) (#4832)
Browse files Browse the repository at this point in the history
This fixes nondeterminism caused by iteration over DenseMap. Instead use MapVector to guarantee determinism.
  • Loading branch information
uenoku authored Mar 15, 2023
1 parent cb96f48 commit 6be27c2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Dialect/FIRRTL/Transforms/ExtractInstances.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -828,7 +828,7 @@ void ExtractInstancesPass::groupInstances() {
// module. Note that we cannot group instances that landed in different parent
// modules into the same submodule, so we use that parent module as a grouping
// key.
SmallDenseMap<std::pair<Operation *, StringRef>, SmallVector<InstanceOp>>
llvm::MapVector<std::pair<Operation *, StringRef>, SmallVector<InstanceOp>>
instsByWrapper;
for (auto &[inst, info] : extractedInstances) {
if (!info.wrapperModule.empty())
Expand Down

0 comments on commit 6be27c2

Please sign in to comment.