This is an archive of the discontinued LLVM Phabricator instance.

[mlir][LLVMIR] Do not create pseudo debug file name using LLVM Instruction name
ClosedPublic

Authored by myhsu on Sep 20 2022, 1:15 PM.

Details

Summary

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:

It brings about 32x speedup.

Here are the OpenSSL results:

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.

Diff Detail

Event Timeline

myhsu created this revision.Sep 20 2022, 1:15 PM
myhsu requested review of this revision.Sep 20 2022, 1:15 PM
myhsu edited the summary of this revision. (Show Details)Sep 20 2022, 9:50 PM
ftynse accepted this revision.Sep 21 2022, 6:30 AM
This revision is now accepted and ready to land.Sep 21 2022, 6:30 AM