Skip to content

Commit d8e67c1

Browse files
vmustyaigcbot
authored andcommitted
Avoid unspecified order of implicit args in VC
`std::unordered_set` used in CMImpParam pass has unspecified order of elemnts. In result we have undefined order of implicit arguments. This system is very fragile so replacing `std::unordered_set` with `std::set`
1 parent 51fd622 commit d8e67c1

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

IGC/VectorCompiler/lib/GenXOpts/CMTrans/CMImpParam.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*========================== begin_copyright_notice ============================
22
3-
Copyright (C) 2017-2021 Intel Corporation
3+
Copyright (C) 2017-2022 Intel Corporation
44
55
SPDX-License-Identifier: MIT
66
@@ -138,6 +138,7 @@ SPDX-License-Identifier: MIT
138138
#include <iterator>
139139
#include <map>
140140
#include <numeric>
141+
#include <set>
141142
#include <stack>
142143
#include <unordered_map>
143144
#include <unordered_set>
@@ -186,7 +187,7 @@ struct LinearizationElt {
186187
using LinearizedTy = std::vector<LinearizationElt>;
187188
using ArgLinearization = std::unordered_map<Argument *, LinearizedTy>;
188189
using ImplArgIntrSeq = std::vector<CallInst *>;
189-
using IntrIDSet = std::unordered_set<unsigned>;
190+
using IntrIDSet = std::set<unsigned>;
190191
using IntrIDMap = std::unordered_map<Function *, IntrIDSet>;
191192

192193
// Implicit args in this pass are denoted by the corresponding intrinsic ID.

0 commit comments

Comments
 (0)