Skip to content

Commit

Permalink
[TableGen,GlobalISel] Use MapVector to stabilize iteration order
Browse files Browse the repository at this point in the history
Otherwise llvm/test/TableGen/GlobalISelCombinerEmitter/type-inference.td
could fail when llvm::hash_value(StringRef) changes.

Fix llvm#66377
  • Loading branch information
MaskRay authored and AlexisPerry committed Jun 27, 2024
1 parent e38270c commit 9e1e2f1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion llvm/utils/TableGen/GlobalISelCombinerEmitter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@ void CombineRuleOperandTypeChecker::getInstEqClasses(
const auto MCOITypes = getMCOIOperandTypes(*CGP);
assert(MCOITypes.size() == P.operands_size());

DenseMap<StringRef, std::vector<unsigned>> TyToOpIdx;
MapVector<StringRef, SmallVector<unsigned, 0>> TyToOpIdx;
for (const auto &[Idx, Ty] : enumerate(MCOITypes))
TyToOpIdx[Ty].push_back(Idx);

Expand Down

0 comments on commit 9e1e2f1

Please sign in to comment.