diff options
author | Nikita Popov <npopov@redhat.com> | 2022-01-24 14:29:05 +0100 |
---|---|---|
committer | Nikita Popov <npopov@redhat.com> | 2022-01-25 09:27:11 +0100 |
commit | 9554aaa2753bd866a00bf6fb4183656200e758e2 (patch) | |
tree | 1f53aeeb4c82c65a030946693d4656fa153801de /llvm/lib/Bitcode/Reader/BitcodeReader.cpp | |
parent | 70cb8daed45fb8a794761a9cfca8432c8ee7c70b (diff) | |
download | llvm-9554aaa2753bd866a00bf6fb4183656200e758e2.zip llvm-9554aaa2753bd866a00bf6fb4183656200e758e2.tar.gz llvm-9554aaa2753bd866a00bf6fb4183656200e758e2.tar.bz2 |
[Dwarf] Optimize getOrCreateSourceID() for repeated calls on same file (NFCI)
DwarfCompileUnit::getOrCreateSourceID() is often called many times
in sequence with the same DIFile. This is currently very expensive,
because it involves creating a string from directory and file name
and looking it up in a string map. This patch remembers the last
DIFile and its ID and directly returns that.
This gives a geomean -1.3% compile-time improvement on CTMark O0-g.
Differential Revision: https://reviews.llvm.org/D118041
Diffstat (limited to 'llvm/lib/Bitcode/Reader/BitcodeReader.cpp')
0 files changed, 0 insertions, 0 deletions