Commit a93ae21
[MLIR] Fix duplicated attribute nodes in MLIR bytecode deserialization (llvm#151267)
Fixes llvm#150163
MLIR bytecode does not preserve alias definitions, so each attribute
encountered during deserialization is treated as a new one. This can
generate duplicate `DISubprogram` nodes during deserialization.
The patch adds a `StringMap` cache that records attributes and fetches
them when encountered again.1 parent 6a252e4 commit a93ae21
File tree
5 files changed
+45
-4
lines changed- mlir
- include/mlir/AsmParser
- lib
- AsmParser
- Bytecode/Reader
- test/IR
5 files changed
+45
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
56 | | - | |
| 56 | + | |
| 57 | + | |
57 | 58 | | |
58 | 59 | | |
59 | 60 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
245 | 245 | | |
246 | 246 | | |
247 | 247 | | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
248 | 257 | | |
249 | 258 | | |
250 | 259 | | |
| |||
337 | 346 | | |
338 | 347 | | |
339 | 348 | | |
| 349 | + | |
340 | 350 | | |
341 | 351 | | |
342 | 352 | | |
| |||
348 | 358 | | |
349 | 359 | | |
350 | 360 | | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
351 | 364 | | |
352 | 365 | | |
353 | 366 | | |
| |||
358 | 371 | | |
359 | 372 | | |
360 | 373 | | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
361 | 379 | | |
362 | 380 | | |
363 | 381 | | |
| |||
374 | 392 | | |
375 | 393 | | |
376 | 394 | | |
377 | | - | |
| 395 | + | |
| 396 | + | |
378 | 397 | | |
379 | | - | |
| 398 | + | |
380 | 399 | | |
381 | 400 | | |
382 | 401 | | |
383 | 402 | | |
384 | 403 | | |
| 404 | + | |
385 | 405 | | |
386 | 406 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
43 | 46 | | |
44 | 47 | | |
45 | 48 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
895 | 895 | | |
896 | 896 | | |
897 | 897 | | |
| 898 | + | |
| 899 | + | |
| 900 | + | |
| 901 | + | |
898 | 902 | | |
899 | 903 | | |
900 | 904 | | |
| |||
1235 | 1239 | | |
1236 | 1240 | | |
1237 | 1241 | | |
1238 | | - | |
| 1242 | + | |
1239 | 1243 | | |
1240 | 1244 | | |
1241 | 1245 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
0 commit comments