tensorflow / mlir

"Multi-Level Intermediate Representation" Compiler Infrastructure
1.73k stars 257 forks source link

[spirv] Deserializer failed with "invalid iterator access" #298

Closed denis0x0D closed 4 years ago

denis0x0D commented 4 years ago

Hi @antiagainst, I'm facing a fail for phi.mlir test after the https://github.com/tensorflow/mlir/commit/0a1828ef3125f1da581f03b3147018b1ccf13cc3

with error: mlir-translate: : AssertionisHandleInSync() && "invalid iterator access!"' failed.`

12 0x000055fc15827630 (anonymous namespace)::ControlFlowStructurizer::structurizeImpl() /home/llvm-project/llvm/projects/mlir/lib/Dialect/SPIRV/Serialization/Deserializer.cpp:1879:27

seems like this should be reordered to avoid invalid iterator fail:

 blockMergeInfo.try_emplace(newHeader, newMerge, newContinue);
 blockMergeInfo.erase(it);

Thanks.

antiagainst commented 4 years ago

Oh, good catch! Could you create a pull request for it? Thanks! :)

denis0x0D commented 4 years ago

@antiagainst thanks for the answer, created https://github.com/tensorflow/mlir/pull/299

antiagainst commented 4 years ago

Fixed via #299.