Include spliced inst value in fingerprint while lowering. (#7739)

This prevents different template instantiations from getting
over-eagerly merged. Unfortunately we don't have a good middle-ground
yet, and this effectively disables all merging for templates. We may be
able to find some smart way to fingerprint spliced instructions so that
we can still merge template instantiations, but for now this change is
just fixing the wrong-code bug.
This commit is contained in:
Richard Smith
2026-09-09 17:54:10 +00:00
committed by GitHub
parent a9fee27bbb
commit 49c6f488b6
4 changed files with 529 additions and 0 deletions
+1
View File
@@ -375,6 +375,7 @@ auto HandleInst(FunctionContext& context, SemIR::InstId inst_id,
inst_ir->constant_values().GetInstAs<SemIR::InstValue>(inst_value_id);
if (inst_ir == &context.sem_ir()) {
// Easy case: same file. Just emit the spliced instruction.
context.AddInstToCurrentFingerprint(inst_value.inst_id);
context.LowerInst(inst_value.inst_id);
context.SetLocal(inst_id, context.GetValue(inst_value.inst_id));
} else {