[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
Loading
Please sign in to comment