Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d52c5f3

Browse files
authored
Avoid mutating stream partition op infos while testing. (iree-org#11465)
Fixes iree-org#11451.
1 parent 034fe6a commit d52c5f3

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

‎compiler/src/iree/compiler/Dialect/Stream/Analysis/Partitioning/ReferencePartitioning.cpp‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,9 @@ PartitionSet partitionStreamableOpsReference(
125125
// dependency chain down the use-def chain to a partition.
126126
llvm::BitVector consumers(builders.size(), /*t=*/false);
127127
for (auto user : op.getUsers()) {
128-
auto &userInfo = opInfos[user];
128+
auto userInfoIt = opInfos.find(user);
129+
if (userInfoIt == opInfos.end()) continue;
130+
auto &userInfo = userInfoIt->second;
129131
LLVM_DEBUG({
130132
llvm::dbgs() << "Testing user:\n";
131133
user->print(llvm::dbgs(), *asmState);
@@ -332,7 +334,9 @@ PartitionSet partitionRegionConcurrencyReference(
332334
// We prune the set based on whether the users are part of a transitive
333335
// dependency chain down the use-def chain to a wave.
334336
for (auto user : op.getUsers()) {
335-
auto &userInfo = opInfos[user];
337+
auto userInfoIt = opInfos.find(user);
338+
if (userInfoIt == opInfos.end()) continue;
339+
auto &userInfo = userInfoIt->second;
336340
LLVM_DEBUG({
337341
llvm::dbgs() << "Testing user:\n";
338342
user->print(llvm::dbgs(), *asmState);

0 commit comments

Comments
 (0)