Change:
shows a pretty big regression between and . I don't know if this is expected, but I'm putting this out there in case others see the dent in perf charts and wonder what had happened. <hr/EDIT( we how have a for . , the other PR in the range, (but only for a small subset of runs).
cc
The range is so the candidates are: "Make the rustc respect the flag in incremental mode." "Add hash of source files in debug info" EDIT: oops, missed - so it's likely . Slow MD5 implementation? I'm curious, why does (merge commit for ) not have its own perf run? Is there a way to trigger one now?
is in the queue:
It looks like this was caused by . I'll start investigating why. I timed several compilations of locally in debug with and without .
For the record, from . I'll update the issue description to minimize potential confusion. Two things I'm seeing: are way worse regressions than , you can focus on the worse ones to get better contrast in measurements (e.g. even has "patched incremental" runs slowed down a lot, unlike many others, being another example I guess) detailed profile (if you click the percentage for a run) shows a lot of LLVM differences, e.g. for , and most of the regressions are , with effectively no ones, so I think we might be able to get away without a revert, just adding a flag controlling whether LLVM sees these hashes (assuming that's the source of the slowdown)
We have (), which at a glance looks right. looks like noise, and so does , so I believe this confirms the fix is complete. For the cost of MD5 hashing compared to SipHash, based on the changes to runs in the original regression, it looks insignificant.

Discussion:
} let loc = cx.lookup_debug_loc(scope_data.span.lo()); <del> let file_metadata = file_metadata(cx, &loc.file.name, debug_context.defining_crate); </del> <ins> let file_metadata = file_metadata(cx, &loc.file, debug_context.defining_crate); </ins> let scope_metadata = unsafe { Some(llvm::LLVMRustDIBuilderCreateLexicalBlock(

use rustc_middle::{bug, span_bug}; use rustc_session::config::{self, DebugInfo}; use rustc_span::symbol::{Interner, Symbol}; <del> use rustc_span::{self, FileName, SourceFileHash, Span}; </del> <ins> use rustc_span::{self, SourceFile, SourceFileHash, Span}; </ins> use rustc_target::abi::{Abi, Align, DiscriminantKind, HasDataLayout, Integer, LayoutOf}; use rustc_target::abi::{Int, Pointer, F32, F64}; use rustc_target::abi::{Primitive, Size, VariantIdx, Variants};

pub fn file_metadata( cx: &CodegenCx<'ll, '_>, <del> file_name: &FileName, </del> <ins> source_file: &SourceFile, </ins> defining_crate: CrateNum, ) -> &'ll DIFile { <del> debug!("file_metadata: file_name: {}, defining_crate: {}", file_name, defining_crate); </del> <ins> debug!("file_metadata: file_name: {}, defining_crate: {}", source_file.name, defining_crate); </ins> <del> let source_file = cx.sess().source_map().get_source_file(file_name); let hash = source_file.as_ref().map(|f| &f.src_hash); let file_name = Some(file_name.to_string()); </del> <ins> let hash = Some(&source_file.src_hash); let file_name = Some(source_file.name.to_string()); </ins> let directory = if defining_crate == LOCAL_CRATE { Some(cx.sess().working_dir.0.to_string_lossy().to_string()) } else {

let (file_metadata, line_number) = if !span.is_dummy() { let loc = cx.lookup_debug_loc(span.lo()); <del> (file_metadata(cx, &loc.file.name, LOCAL_CRATE), loc.line) </del> <ins> (file_metadata(cx, &loc.file, LOCAL_CRATE), loc.line) </ins> } else { (unknown_file_metadata(cx), None) };

file: &rustc_span::SourceFile, defining_crate: CrateNum, ) -> &'ll DILexicalBlock { <del> let file_metadata = file_metadata(cx, &file.name, defining_crate); </del> <ins> let file_metadata = file_metadata(cx, &file, defining_crate); </ins> unsafe { llvm::LLVMRustDIBuilderCreateLexicalBlockFile(DIB(cx), scope_metadata, file_metadata) } }

let def_id = instance.def_id(); let containing_scope = get_containing_scope(self, instance); let loc = self.lookup_debug_loc(span.lo()); <del> let file_metadata = file_metadata(self, &loc.file.name, def_id.krate); </del> <ins> let file_metadata = file_metadata(self, &loc.file, def_id.krate); </ins> let function_type_metadata = unsafe { let fn_signature = get_function_signature(self, fn_abi);

span: Span, ) -> &'ll DIVariable { let loc = self.lookup_debug_loc(span.lo()); <del> let file_metadata = file_metadata(self, &loc.file.name, dbg_context.defining_crate); </del> <ins> let file_metadata = file_metadata(self, &loc.file, dbg_context.defining_crate); </ins> let type_metadata = type_metadata(self, variable_type, span);