mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user