Skip to content

Commit af7ee51

Browse files
author
Jeff Niu
authored
[mlir][bytecode] Fix external resource bytecode parsing (#97650)
The key was being dropped for external resources because they aren't present in the dialect resource name mapper.
1 parent 10b43f4 commit af7ee51

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

mlir/lib/Bytecode/Reader/BytecodeReader.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -706,7 +706,7 @@ LogicalResult ResourceSectionReader::initialize(
706706
auto resolveKey = [&](StringRef key) -> StringRef {
707707
auto it = dialectResourceHandleRenamingMap.find(key);
708708
if (it == dialectResourceHandleRenamingMap.end())
709-
return "";
709+
return key;
710710
return it->second;
711711
};
712712

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// RUN: mlir-opt %s -emit-bytecode | mlir-opt | FileCheck %s
2+
3+
module {
4+
}
5+
6+
{-#
7+
// CHECK: external_resources
8+
external_resources: {
9+
// CHECK-NEXT: mlir_reproducer
10+
mlir_reproducer: {
11+
// CHECK-NEXT: pipeline: "builtin.module(func.func(canonicalize,cse))",
12+
pipeline: "builtin.module(func.func(canonicalize,cse))",
13+
// CHECK-NEXT: disable_threading: true
14+
disable_threading: true,
15+
// CHECK-NEXT: verify_each: true
16+
verify_each: true
17+
}
18+
}
19+
#-}

0 commit comments

Comments
 (0)