Skip to content

Commit 62877e3

Browse files
wangpc-pptstellar
authored andcommitted
[TableGen] Use MapVector to remove non-determinism
This fixes found non-determinism when `LLVM_REVERSE_ITERATION` option is `ON`. Fixes #79420. Reviewers: ilovepi, MaskRay Reviewed By: MaskRay Pull Request: #79411 (cherry picked from commit 41fe98a)
1 parent ed48280 commit 62877e3

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

llvm/test/TableGen/address-space-patfrags.td

+2-2
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def inst_d : Instruction {
4646
let InOperandList = (ins GPR32:$src0, GPR32:$src1);
4747
}
4848

49-
// SDAG: case 1: {
49+
// SDAG: case 0: {
5050
// SDAG-NEXT: // Predicate_pat_frag_b
5151
// SDAG-NEXT: // Predicate_truncstorei16_addrspace
5252
// SDAG-NEXT: SDNode *N = Node;
@@ -69,7 +69,7 @@ def : Pat <
6969
>;
7070

7171

72-
// SDAG: case 6: {
72+
// SDAG: case 4: {
7373
// SDAG: // Predicate_pat_frag_a
7474
// SDAG-NEXT: SDNode *N = Node;
7575
// SDAG-NEXT: (void)N;

llvm/utils/TableGen/DAGISelMatcherEmitter.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@ class MatcherTableEmitter {
5757

5858
// We de-duplicate the predicates by code string, and use this map to track
5959
// all the patterns with "identical" predicates.
60-
StringMap<TinyPtrVector<TreePattern *>> NodePredicatesByCodeToRun;
60+
MapVector<std::string, TinyPtrVector<TreePattern *>, StringMap<unsigned>>
61+
NodePredicatesByCodeToRun;
6162

6263
std::vector<std::string> PatternPredicates;
6364

0 commit comments

Comments
 (0)