Previously in mlir-translate, if debug info was absent in a llvm::Instruction, we tried to create one using the name of its defined value in a textual LLVM IR file as the (pseudo) debug file name. However, in order to get that name, we need to call out to LLVM's SlotTracker, which, surprisingly, took a lot of time. Judging from the usefulness of such pseudo debug file name and the performance penalty during translation, this patch simply use "imported-bitcode" as the debug file name in these case. Eliminating the need of using (expensive) LLVM value numbering.
To give a better idea, we did some profiling on using mlir-translate to translate Nginx and OpenSSL.
Here are the Nginx results:
- Before the patch: https://i.imgur.com/gox2RZt.png
- After the patch: https://i.imgur.com/hadb4kX.png
It brings about 32x speedup.
Here are the OpenSSL results:
- Before the patch: https://i.imgur.com/z17VTpG.png
- After the patch: https://i.imgur.com/zCjui0M.png
It brings about 2~3x speedup.
Note: I'm not really sure about the test, so I only added some basic checks on translating instructions without any LLVM debug info metadata.