Skip to content

Commit 0a3ef6a

Browse files
committed
[mlir] fix infinite while in 1:N dialect conversion
1 parent 1865048 commit 0a3ef6a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

mlir/lib/Transforms/Utils/DialectConversion.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,8 +201,9 @@ ConversionValueMapping::lookupOrDefault(Value from,
201201
// If possible, Replace each value with (one or multiple) mapped values.
202202
ValueVector next;
203203
for (Value v : current) {
204-
auto it = mapping.find({v});
205-
if (it != mapping.end()) {
204+
ValueVector vv{v};
205+
auto it = mapping.find(vv);
206+
if (it != mapping.end() && it->first != vv) {
206207
llvm::append_range(next, it->second);
207208
} else {
208209
next.push_back(v);

0 commit comments

Comments
 (0)