mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
Disable InstNamer in lowering unless we're emitting textual llvm IR (#7878)
`InstNamer` takes O(N^2) time to resolve N colliding inst names, so it should be limited to textual dumps (where we can presumably prioritize readability over performance). Without this change, compiling 200,000 destructor calls took hours. With this change, compiling 1,000,000 destructor calls takes about 30 seconds.
This commit is contained in:
@@ -191,6 +191,8 @@ auto CompilationUnit::RunLower() -> void {
|
||||
options.vlog_stream = vlog_stream_;
|
||||
options.opt_level = options_->opt_level;
|
||||
options.mangle_string_fingerprint = options_->mangle_string_fingerprint;
|
||||
// Only generate inst names if the llvm IR needs to be human-readable.
|
||||
options.generate_inst_names = options_->dump_llvm_ir;
|
||||
module_ = Lower::LowerToLLVM(*llvm_context_, driver_env_->fs,
|
||||
cache_->tree_and_subtrees_getters(), *sem_ir_,
|
||||
total_ir_count_, options);
|
||||
|
||||
Reference in New Issue
Block a user