From a2737a318905d7c920616cd1b1d0cf4515dc1f91 Mon Sep 17 00:00:00 2001 From: Geoff Romer Date: Tue, 13 Jan 2026 11:30:15 -0800 Subject: [PATCH] Add `Call` param patterns to `Function` (#6586) --- toolchain/check/cpp/import.cpp | 7 +- toolchain/check/custom_witness.cpp | 3 +- toolchain/check/global_init.cpp | 3 +- toolchain/check/handle_function.cpp | 4 +- toolchain/check/handle_impl.cpp | 10 +- toolchain/check/import_ref.cpp | 7 +- toolchain/check/name_component.cpp | 8 +- toolchain/check/name_component.h | 4 +- toolchain/check/pattern_match.cpp | 131 ++++-- toolchain/check/pattern_match.h | 10 +- .../basics/raw_sem_ir/cpp_interop.carbon | 74 ++-- .../basics/raw_sem_ir/multifile.carbon | 6 +- .../multifile_with_textual_ir.carbon | 6 +- .../basics/raw_sem_ir/one_file.carbon | 378 +++++++++--------- .../one_file_with_textual_ir.carbon | 27 +- toolchain/check/thunk.cpp | 5 +- toolchain/sem_ir/function.h | 24 +- 17 files changed, 409 insertions(+), 298 deletions(-) diff --git a/toolchain/check/cpp/import.cpp b/toolchain/check/cpp/import.cpp index fc7ec9a2264e..0f916a16802d 100644 --- a/toolchain/check/cpp/import.cpp +++ b/toolchain/check/cpp/import.cpp @@ -1289,6 +1289,7 @@ struct FunctionSignatureInsts { SemIR::TypeInstId return_type_inst_id; SemIR::InstId return_form_inst_id; SemIR::InstBlockId return_patterns_id; + SemIR::InstBlockId call_param_patterns_id; SemIR::InstBlockId call_params_id; }; } // namespace @@ -1325,7 +1326,7 @@ static auto CreateFunctionSignatureInsts(Context& context, SemIR::LocId loc_id, } pop.reset(); - auto call_params_id = + auto [call_param_patterns_id, call_params_id] = CalleePatternMatch(context, implicit_param_patterns_id, param_patterns_id, return_patterns_id); @@ -1334,6 +1335,7 @@ static auto CreateFunctionSignatureInsts(Context& context, SemIR::LocId loc_id, .return_type_inst_id = return_type_inst_id, .return_form_inst_id = return_form_inst_id, .return_patterns_id = return_patterns_id, + .call_param_patterns_id = call_param_patterns_id, .call_params_id = call_params_id}}; } @@ -1422,7 +1424,8 @@ static auto ImportFunction(Context& context, SemIR::LocId loc_id, .non_owning_decl_id = SemIR::InstId::None, .first_owning_decl_id = decl_id, .definition_id = SemIR::InstId::None}, - {.call_params_id = function_params_insts->call_params_id, + {.call_param_patterns_id = function_params_insts->call_param_patterns_id, + .call_params_id = function_params_insts->call_params_id, .return_type_inst_id = function_params_insts->return_type_inst_id, .return_form_inst_id = function_params_insts->return_form_inst_id, .return_patterns_id = function_params_insts->return_patterns_id, diff --git a/toolchain/check/custom_witness.cpp b/toolchain/check/custom_witness.cpp index 9ef908c94d9c..1ea791a98a2e 100644 --- a/toolchain/check/custom_witness.cpp +++ b/toolchain/check/custom_witness.cpp @@ -58,7 +58,7 @@ static auto MakeNoOpFunction(Context& context, SemIR::LocId loc_id, context, loc_id, SemIR::NameId::SelfValue, type_expr_region_id, type_id, /*is_ref=*/true); auto implicit_param_patterns_id = context.inst_blocks().Add({self_param_id}); - auto call_params_id = + auto [call_param_patterns_id, call_params_id] = CalleePatternMatch(context, implicit_param_patterns_id, /*param_patterns_id=*/SemIR::InstBlockId::Empty, /*return_patterns_id=*/SemIR::InstBlockId::None); @@ -95,6 +95,7 @@ static auto MakeNoOpFunction(Context& context, SemIR::LocId loc_id, .first_owning_decl_id = noop_id, }, { + .call_param_patterns_id = call_param_patterns_id, .call_params_id = call_params_id, .return_type_inst_id = SemIR::TypeInstId::None, .return_form_inst_id = SemIR::InstId::None, diff --git a/toolchain/check/global_init.cpp b/toolchain/check/global_init.cpp index 13615e8960ea..a9f511854f73 100644 --- a/toolchain/check/global_init.cpp +++ b/toolchain/check/global_init.cpp @@ -48,7 +48,8 @@ auto GlobalInit::Finalize() -> void { .extern_library_id = SemIR::LibraryNameId::None, .non_owning_decl_id = SemIR::InstId::None, .first_owning_decl_id = SemIR::InstId::None}, - {.call_params_id = SemIR::InstBlockId::Empty, + {.call_param_patterns_id = SemIR::InstBlockId::Empty, + .call_params_id = SemIR::InstBlockId::Empty, .return_type_inst_id = SemIR::TypeInstId::None, .return_form_inst_id = SemIR::InstId::None, .return_patterns_id = SemIR::InstBlockId::None, diff --git a/toolchain/check/handle_function.cpp b/toolchain/check/handle_function.cpp index e896555ef401..e11047c70251 100644 --- a/toolchain/check/handle_function.cpp +++ b/toolchain/check/handle_function.cpp @@ -188,6 +188,7 @@ static auto MergeFunctionRedecl(Context& context, // Track the signature from the definition, so that IDs in the body // match IDs in the signature. prev_function.MergeDefinition(new_function); + prev_function.call_param_patterns_id = new_function.call_param_patterns_id; prev_function.call_params_id = new_function.call_params_id; prev_function.return_type_inst_id = new_function.return_type_inst_id; prev_function.return_form_inst_id = new_function.return_form_inst_id; @@ -449,7 +450,8 @@ static auto BuildFunctionDecl(Context& context, auto function_info = SemIR::Function{name_context.MakeEntityWithParamsBase( name, decl_id, is_extern, introducer.extern_library), - {.call_params_id = name.call_params_id, + {.call_param_patterns_id = name.call_param_patterns_id, + .call_params_id = name.call_params_id, .return_type_inst_id = return_type_inst_id, .return_form_inst_id = return_form_inst_id, .return_patterns_id = return_patterns_id, diff --git a/toolchain/check/handle_impl.cpp b/toolchain/check/handle_impl.cpp index 2782ebc33488..b1c9519d74da 100644 --- a/toolchain/check/handle_impl.cpp +++ b/toolchain/check/handle_impl.cpp @@ -156,14 +156,11 @@ static auto PopImplIntroducerAndParamsAsNameComponent( .PopAndDiscardSoloNodeId(); // Emit the `forall` match. This shouldn't produce any valid `Call` params, // because `impl`s are never actually called at runtime. - auto call_params_id = + auto [call_param_patterns_id, call_params_id] = CalleePatternMatch(context, *implicit_param_patterns_id, SemIR::InstBlockId::None, SemIR::InstBlockId::None); - CARBON_CHECK(call_params_id == SemIR::InstBlockId::Empty || - llvm::all_of(context.inst_blocks().Get(call_params_id), - [](SemIR::InstId inst_id) { - return inst_id == SemIR::ErrorInst::InstId; - })); + CARBON_CHECK(call_params_id == SemIR::InstBlockId::Empty); + CARBON_CHECK(call_param_patterns_id == SemIR::InstBlockId::Empty); } Parse::NodeId first_param_node_id = @@ -187,6 +184,7 @@ static auto PopImplIntroducerAndParamsAsNameComponent( implicit_param_patterns_id.value_or(SemIR::InstBlockId::None), .params_loc_id = Parse::NodeId::None, .param_patterns_id = SemIR::InstBlockId::None, + .call_param_patterns_id = SemIR::InstBlockId::None, .call_params_id = SemIR::InstBlockId::None, .pattern_block_id = pattern_block_id}; } diff --git a/toolchain/check/import_ref.cpp b/toolchain/check/import_ref.cpp index 70b4a2c29f0d..05061c19dcb7 100644 --- a/toolchain/check/import_ref.cpp +++ b/toolchain/check/import_ref.cpp @@ -2183,7 +2183,8 @@ static auto MakeFunctionDecl(ImportContext& context, // Start with an incomplete function. function_decl.function_id = context.local_functions().Add( {GetIncompleteLocalEntityBase(context, function_decl_id, import_function), - {.call_params_id = SemIR::InstBlockId::None, + {.call_param_patterns_id = SemIR::InstBlockId::None, + .call_params_id = SemIR::InstBlockId::None, .return_type_inst_id = SemIR::TypeInstId::None, .return_form_inst_id = SemIR::InstId::None, .return_patterns_id = SemIR::InstBlockId::None, @@ -2241,6 +2242,8 @@ static auto TryResolveTypedInst(ImportRefResolver& resolver, function_id = function_type.function_id; } + auto call_param_patterns = GetLocalInstBlockContents( + resolver, import_function.call_param_patterns_id); auto return_type_const_id = SemIR::ConstantId::None; if (import_function.return_type_inst_id.has_value()) { return_type_const_id = @@ -2269,6 +2272,8 @@ static auto TryResolveTypedInst(ImportRefResolver& resolver, } // Add the function declaration. + new_function.call_param_patterns_id = GetLocalCanonicalInstBlockId( + resolver, import_function.call_param_patterns_id, call_param_patterns); new_function.parent_scope_id = parent_scope_id; new_function.implicit_param_patterns_id = GetLocalCanonicalInstBlockId( resolver, import_function.implicit_param_patterns_id, diff --git a/toolchain/check/name_component.cpp b/toolchain/check/name_component.cpp index 3f88bee61407..5c375823b461 100644 --- a/toolchain/check/name_component.cpp +++ b/toolchain/check/name_component.cpp @@ -44,13 +44,16 @@ auto PopNameComponent(Context& context, SemIR::InstBlockId return_patterns_id) implicit_param_patterns_id = SemIR::InstBlockId::None; } + auto call_param_patterns_id = SemIR::InstBlockId::None; auto call_params_id = SemIR::InstBlockId::None; auto pattern_block_id = SemIR::InstBlockId::None; if (param_patterns_id->has_value() || implicit_param_patterns_id->has_value() || (!context.inst_blocks().GetOrEmpty(return_patterns_id).empty())) { - call_params_id = CalleePatternMatch(context, *implicit_param_patterns_id, - *param_patterns_id, return_patterns_id); + auto results = CalleePatternMatch(context, *implicit_param_patterns_id, + *param_patterns_id, return_patterns_id); + call_param_patterns_id = results.call_param_patterns_id; + call_params_id = results.call_params_id; pattern_block_id = context.pattern_block_stack().Pop(); context.full_pattern_stack().PopFullPattern(); } @@ -67,6 +70,7 @@ auto PopNameComponent(Context& context, SemIR::InstBlockId return_patterns_id) .implicit_param_patterns_id = *implicit_param_patterns_id, .params_loc_id = params_node_id, .param_patterns_id = *param_patterns_id, + .call_param_patterns_id = call_param_patterns_id, .call_params_id = call_params_id, .pattern_block_id = pattern_block_id, }; diff --git a/toolchain/check/name_component.h b/toolchain/check/name_component.h index 0e017751d814..67daaf9c2af2 100644 --- a/toolchain/check/name_component.h +++ b/toolchain/check/name_component.h @@ -35,7 +35,9 @@ struct NameComponent { SemIR::InstBlockId param_patterns_id; // The `Call` parameters of the entity, if it's a function (see the - // corresponding member of SemIR::EntityWithParamsBase). + // corresponding members of SemIR::FunctionFields and + // SemIR::EntityWithParamsBase). + SemIR::InstBlockId call_param_patterns_id; SemIR::InstBlockId call_params_id; // The pattern block. diff --git a/toolchain/check/pattern_match.cpp b/toolchain/check/pattern_match.cpp index 0a7b868b0ea7..d8cf1482da76 100644 --- a/toolchain/check/pattern_match.cpp +++ b/toolchain/check/pattern_match.cpp @@ -68,11 +68,20 @@ class MatchContext { // Adds a work item to the stack. auto AddWork(WorkItem work_item) -> void { stack_.push_back(work_item); } - // Processes all work items on the stack. When performing caller pattern - // matching, returns an inst block with one inst reference for each - // calling-convention argument. When performing callee pattern matching, - // returns an inst block with references to all the emitted BindName insts. - auto DoWork(Context& context) -> SemIR::InstBlockId; + // Processes all work items on the stack. + auto DoWork(Context& context) -> void; + + // Returns an inst block of references to all the emitted `Call` arguments. + // Can only be called once, at the end of Caller pattern matching. + auto CallerResults(Context& context) && -> SemIR::InstBlockId; + + // Returns an inst block of references to all the emitted `Call` params, + // and an inst block of references to the `Call` param patterns they were + // emitted to match. Can only be called once, at the end of Callee pattern + // matching. + auto CalleeResults(Context& context) && -> CalleePatternMatchResults; + + ~MatchContext(); private: // Emits the pattern-match insts necessary to match the pattern inst @@ -115,12 +124,17 @@ class MatchContext { // The stack of work to be processed. llvm::SmallVector stack_; - // The pending results that will be returned by the current `DoWork` call. - // It represents the contents of the `Call` arguments block when kind_ - // is Caller, or the `Call` parameters block when kind_ is Callee - // (it is empty when kind_ is Local). Consequently, it is populated - // only by DoEmitPatternMatch for *ParamPattern insts. - llvm::SmallVector results_; + // The in-progress contents of the `Call` arguments block. This is populated + // only when kind_ is Caller. + llvm::SmallVector call_args_; + + // The in-progress contents of the `Call` parameters block. This is populated + // only when kind_ is Callee. + llvm::SmallVector call_params_; + + // The in-progress contents of the `Call` parameter patterns block. This is + // populated only when kind_ is Callee. + llvm::SmallVector call_param_patterns_; // The kind of pattern match being performed. MatchKind kind_; @@ -131,16 +145,55 @@ class MatchContext { } // namespace -auto MatchContext::DoWork(Context& context) -> SemIR::InstBlockId { - results_.reserve(stack_.size()); +auto MatchContext::DoWork(Context& context) -> void { + CARBON_CHECK(call_args_.empty() && call_params_.empty() && + call_param_patterns_.empty()); + switch (kind_) { + case MatchKind::Caller: { + call_args_.reserve(stack_.size()); + break; + } + case MatchKind::Callee: { + call_param_patterns_.reserve(stack_.size()); + call_params_.reserve(stack_.size()); + break; + } + case MatchKind::Local: + break; + } while (!stack_.empty()) { EmitPatternMatch(context, stack_.pop_back_val()); } - auto block_id = context.inst_blocks().Add(results_); - results_.clear(); +} + +auto MatchContext::CallerResults(Context& context) && -> SemIR::InstBlockId { + CARBON_CHECK(kind_ == MatchKind::Caller); + auto block_id = context.inst_blocks().Add(call_args_); + call_args_.clear(); return block_id; } +auto MatchContext::CalleeResults( + Context& context) && -> CalleePatternMatchResults { + CARBON_CHECK(kind_ == MatchKind::Callee); + CARBON_CHECK(call_params_.size() == call_param_patterns_.size()); + auto call_param_patterns_id = context.inst_blocks().Add(call_param_patterns_); + call_param_patterns_.clear(); + auto call_params_id = context.inst_blocks().Add(call_params_); + call_params_.clear(); + return {.call_param_patterns_id = call_param_patterns_id, + .call_params_id = call_params_id}; +} + +MatchContext::~MatchContext() { + CARBON_CHECK(call_args_.empty() && call_params_.empty() && + call_param_patterns_.empty(), + "Unhandled pattern matching outputs. call_args_.size(): {0}, " + "call_params_.size(): {1}, call_param_patterns_.size(): {2}", + call_args_.size(), call_params_.size(), + call_param_patterns_.size()); +} + // Inserts the given region into the current code block. If the region // consists of a single block, this will be implemented as a `splice_block` // inst. Otherwise, this will end the current block with a branch to the entry @@ -250,14 +303,14 @@ auto MatchContext::DoEmitPatternMatch(Context& context, switch (kind_) { case MatchKind::Caller: { CARBON_CHECK( - static_cast(param_pattern.index.index) == results_.size(), - "Parameters out of order; expecting {0} but got {1}", results_.size(), - param_pattern.index.index); + static_cast(param_pattern.index.index) == call_args_.size(), + "Parameters out of order; expecting {0} but got {1}", + call_args_.size(), param_pattern.index.index); CARBON_CHECK(entry.scrutinee_id.has_value()); if (entry.scrutinee_id == SemIR::ErrorInst::InstId) { - results_.push_back(SemIR::ErrorInst::InstId); + call_args_.push_back(SemIR::ErrorInst::InstId); } else { - results_.push_back(ConvertToValueOfType( + call_args_.push_back(ConvertToValueOfType( context, SemIR::LocId(entry.scrutinee_id), entry.scrutinee_id, ExtractScrutineeType( context.sem_ir(), @@ -278,7 +331,8 @@ auto MatchContext::DoEmitPatternMatch(Context& context, context.sem_ir(), entry.pattern_id)}); AddWork({.pattern_id = param_pattern.subpattern_id, .scrutinee_id = param_id}); - results_.push_back(param_id); + call_params_.push_back(param_id); + call_param_patterns_.push_back(entry.pattern_id); break; } case MatchKind::Local: { @@ -296,20 +350,20 @@ auto MatchContext::DoEmitPatternMatch(Context& context, switch (kind_) { case MatchKind::Caller: { CARBON_CHECK( - static_cast(param_pattern.index.index) == results_.size(), - "Parameters out of order; expecting {0} but got {1}", results_.size(), - param_pattern.index.index); + static_cast(param_pattern.index.index) == call_args_.size(), + "Parameters out of order; expecting {0} but got {1}", + call_args_.size(), param_pattern.index.index); CARBON_CHECK(entry.scrutinee_id.has_value()); if (std::is_same_v) { - results_.push_back(entry.scrutinee_id); + call_args_.push_back(entry.scrutinee_id); break; } auto scrutinee_type_id = ExtractScrutineeType( context.sem_ir(), SemIR::GetTypeOfInstInSpecific(context.sem_ir(), callee_specific_id_, entry.pattern_id)); - results_.push_back(Convert( + call_args_.push_back(Convert( context, SemIR::LocId(entry.scrutinee_id), entry.scrutinee_id, {.kind = entry.allow_unmarked_ref ? ConversionTarget::UnmarkedRefParam : ConversionTarget::RefParam, @@ -328,7 +382,8 @@ auto MatchContext::DoEmitPatternMatch(Context& context, context.sem_ir(), entry.pattern_id)}); AddWork({.pattern_id = param_pattern.subpattern_id, .scrutinee_id = param_id}); - results_.push_back(param_id); + call_params_.push_back(param_id); + call_param_patterns_.push_back(entry.pattern_id); break; } case MatchKind::Local: { @@ -343,9 +398,9 @@ auto MatchContext::DoEmitPatternMatch(Context& context, switch (kind_) { case MatchKind::Caller: { CARBON_CHECK( - static_cast(param_pattern.index.index) == results_.size(), - "Parameters out of order; expecting {0} but got {1}", results_.size(), - param_pattern.index.index); + static_cast(param_pattern.index.index) == call_args_.size(), + "Parameters out of order; expecting {0} but got {1}", + call_args_.size(), param_pattern.index.index); CARBON_CHECK(entry.scrutinee_id.has_value()); CARBON_CHECK( context.insts().Get(entry.scrutinee_id).type_id() == @@ -353,7 +408,7 @@ auto MatchContext::DoEmitPatternMatch(Context& context, context.sem_ir(), SemIR::GetTypeOfInstInSpecific( context.sem_ir(), callee_specific_id_, entry.pattern_id))); - results_.push_back(entry.scrutinee_id); + call_args_.push_back(entry.scrutinee_id); // Do not traverse farther, because the caller side of the pattern // ends here. break; @@ -370,7 +425,8 @@ auto MatchContext::DoEmitPatternMatch(Context& context, context.sem_ir(), entry.pattern_id)}); AddWork({.pattern_id = param_pattern.subpattern_id, .scrutinee_id = param_id}); - results_.push_back(param_id); + call_param_patterns_.push_back(entry.pattern_id); + call_params_.push_back(param_id); break; } case MatchKind::Local: { @@ -588,10 +644,11 @@ auto CalleePatternMatch(Context& context, SemIR::InstBlockId implicit_param_patterns_id, SemIR::InstBlockId param_patterns_id, SemIR::InstBlockId return_patterns_id) - -> SemIR::InstBlockId { + -> CalleePatternMatchResults { if (!return_patterns_id.has_value() && !param_patterns_id.has_value() && !implicit_param_patterns_id.has_value()) { - return SemIR::InstBlockId::None; + return {.call_param_patterns_id = SemIR::InstBlockId::None, + .call_params_id = SemIR::InstBlockId::None}; } MatchContext match(MatchKind::Callee); @@ -620,7 +677,8 @@ auto CalleePatternMatch(Context& context, } } - return match.DoWork(context); + match.DoWork(context); + return std::move(match).CalleeResults(context); } auto CallerPatternMatch(Context& context, SemIR::SpecificId specific_id, @@ -661,7 +719,8 @@ auto CallerPatternMatch(Context& context, SemIR::SpecificId specific_id, .allow_unmarked_ref = true}); } - return match.DoWork(context); + match.DoWork(context); + return std::move(match).CallerResults(context); } auto LocalPatternMatch(Context& context, SemIR::InstId pattern_id, diff --git a/toolchain/check/pattern_match.h b/toolchain/check/pattern_match.h index a655464c8cca..a56d219bbb09 100644 --- a/toolchain/check/pattern_match.h +++ b/toolchain/check/pattern_match.h @@ -24,13 +24,17 @@ namespace Carbon::Check { // callee side of pattern matching, starting at the `ParamPattern` insts, and // matching them against the corresponding `Call` parameters (see // entity_with_params_base.h for the definition of that term). -// Returns the ID of an inst block consisting of references to the `Call` -// parameters of the function. +// Returns the IDs of inst blocks consisting of references to the `Call` +// parameter patterns and `Call` parameters of the function. +struct CalleePatternMatchResults { + SemIR::InstBlockId call_param_patterns_id; + SemIR::InstBlockId call_params_id; +}; auto CalleePatternMatch(Context& context, SemIR::InstBlockId implicit_param_patterns_id, SemIR::InstBlockId param_patterns_id, SemIR::InstBlockId return_patterns_id) - -> SemIR::InstBlockId; + -> CalleePatternMatchResults; // Emits the pattern-match IR for matching the given arguments with the given // parameter patterns, and returns an inst block of the arguments that should diff --git a/toolchain/check/testdata/basics/raw_sem_ir/cpp_interop.carbon b/toolchain/check/testdata/basics/raw_sem_ir/cpp_interop.carbon index f507f5b71f4e..69937ca02cbb 100644 --- a/toolchain/check/testdata/basics/raw_sem_ir/cpp_interop.carbon +++ b/toolchain/check/testdata/basics/raw_sem_ir/cpp_interop.carbon @@ -63,13 +63,13 @@ fn G(x: Cpp.X) { // CHECK:STDOUT: cpp_global_vars: // CHECK:STDOUT: cpp_global_var60000000: {key: {entity_name_id: entity_name60000003}, clang_decl_id: clang_decl_id60000007} // CHECK:STDOUT: functions: -// CHECK:STDOUT: function60000000: {name: name0, parent_scope: name_scope0, call_params_id: inst_block60000006, body: [inst_block60000009]} -// CHECK:STDOUT: function60000001: {name: name3, parent_scope: name_scope60000001, call_params_id: inst_block_empty} -// CHECK:STDOUT: function60000002: {name: name6, parent_scope: name_scope60000001, call_params_id: inst_block_empty} -// CHECK:STDOUT: function60000003: {name: name3, parent_scope: name_scope60000001, call_params_id: inst_block6000000D} -// CHECK:STDOUT: function60000004: {name: name6, parent_scope: name_scope60000001, call_params_id: inst_block60000012} +// CHECK:STDOUT: function60000000: {name: name0, parent_scope: name_scope0, call_param_patterns_id: inst_block60000006, call_params_id: inst_block60000007, body: [inst_block6000000A]} +// CHECK:STDOUT: function60000001: {name: name3, parent_scope: name_scope60000001, call_param_patterns_id: inst_block_empty, call_params_id: inst_block_empty} +// CHECK:STDOUT: function60000002: {name: name6, parent_scope: name_scope60000001, call_param_patterns_id: inst_block_empty, call_params_id: inst_block_empty} +// CHECK:STDOUT: function60000003: {name: name3, parent_scope: name_scope60000001, call_param_patterns_id: inst_block6000000E, call_params_id: inst_block6000000F} +// CHECK:STDOUT: function60000004: {name: name6, parent_scope: name_scope60000001, call_param_patterns_id: inst_block60000014, call_params_id: inst_block60000015} // CHECK:STDOUT: classes: -// CHECK:STDOUT: class60000000: {name: name2, parent_scope: name_scope60000001, self_type_id: type(inst60000015), inheritance_kind: Base, is_dynamic: 0, scope_id: name_scope60000002, body_block_id: inst_block6000000A, adapt_id: inst, base_id: inst, complete_type_witness_id: inst60000025, vtable_decl_id: inst}} +// CHECK:STDOUT: class60000000: {name: name2, parent_scope: name_scope60000001, self_type_id: type(inst60000015), inheritance_kind: Base, is_dynamic: 0, scope_id: name_scope60000002, body_block_id: inst_block6000000B, adapt_id: inst, base_id: inst, complete_type_witness_id: inst60000025, vtable_decl_id: inst}} // CHECK:STDOUT: generics: {} // CHECK:STDOUT: specifics: {} // CHECK:STDOUT: struct_type_fields: @@ -143,7 +143,7 @@ fn G(x: Cpp.X) { // CHECK:STDOUT: inst6000001A: {kind: ValueParamPattern, arg0: inst60000019, arg1: call_param0, type: type(inst60000018)} // CHECK:STDOUT: inst6000001B: {kind: ValueParam, arg0: call_param0, arg1: name1, type: type(inst60000015)} // CHECK:STDOUT: inst6000001C: {kind: SpliceBlock, arg0: inst_block60000004, arg1: inst60000016, type: type(TypeType)} -// CHECK:STDOUT: inst6000001D: {kind: FunctionDecl, arg0: function60000000, arg1: inst_block60000008, type: type(inst6000001E)} +// CHECK:STDOUT: inst6000001D: {kind: FunctionDecl, arg0: function60000000, arg1: inst_block60000009, type: type(inst6000001E)} // CHECK:STDOUT: inst6000001E: {kind: FunctionType, arg0: function60000000, arg1: specific, type: type(TypeType)} // CHECK:STDOUT: inst6000001F: {kind: StructValue, arg0: inst_block_empty, type: type(inst6000001E)} // CHECK:STDOUT: inst60000020: {kind: PointerType, arg0: inst60000015, type: type(TypeType)} @@ -173,7 +173,7 @@ fn G(x: Cpp.X) { // CHECK:STDOUT: inst60000038: {kind: ValueBindingPattern, arg0: entity_name60000001, type: type(inst60000018)} // CHECK:STDOUT: inst60000039: {kind: ValueParamPattern, arg0: inst60000038, arg1: call_param0, type: type(inst60000018)} // CHECK:STDOUT: inst6000003A: {kind: ValueParam, arg0: call_param0, arg1: name1, type: type(inst60000015)} -// CHECK:STDOUT: inst6000003B: {kind: FunctionDecl, arg0: function60000003, arg1: inst_block6000000F, type: type(inst6000003C)} +// CHECK:STDOUT: inst6000003B: {kind: FunctionDecl, arg0: function60000003, arg1: inst_block60000011, type: type(inst6000003C)} // CHECK:STDOUT: inst6000003C: {kind: FunctionType, arg0: function60000003, arg1: specific, type: type(TypeType)} // CHECK:STDOUT: inst6000003D: {kind: StructValue, arg0: inst_block_empty, type: type(inst6000003C)} // CHECK:STDOUT: inst6000003E: {kind: ValueBinding, arg0: entity_name60000002, arg1: inst60000042, type: type(inst60000020)} @@ -181,12 +181,12 @@ fn G(x: Cpp.X) { // CHECK:STDOUT: inst60000040: {kind: ValueBindingPattern, arg0: entity_name60000002, type: type(inst6000003F)} // CHECK:STDOUT: inst60000041: {kind: ValueParamPattern, arg0: inst60000040, arg1: call_param0, type: type(inst6000003F)} // CHECK:STDOUT: inst60000042: {kind: ValueParam, arg0: call_param0, arg1: name1, type: type(inst60000020)} -// CHECK:STDOUT: inst60000043: {kind: FunctionDecl, arg0: function60000004, arg1: inst_block60000014, type: type(inst60000044)} +// CHECK:STDOUT: inst60000043: {kind: FunctionDecl, arg0: function60000004, arg1: inst_block60000017, type: type(inst60000044)} // CHECK:STDOUT: inst60000044: {kind: FunctionType, arg0: function60000004, arg1: specific, type: type(TypeType)} // CHECK:STDOUT: inst60000045: {kind: StructValue, arg0: inst_block_empty, type: type(inst60000044)} // CHECK:STDOUT: inst60000046: {kind: ValueAsRef, arg0: inst60000036, type: type(inst60000015)} // CHECK:STDOUT: inst60000047: {kind: AddrOf, arg0: inst60000046, type: type(inst60000020)} -// CHECK:STDOUT: inst60000048: {kind: Call, arg0: inst60000043, arg1: inst_block60000016, type: type(inst60000013)} +// CHECK:STDOUT: inst60000048: {kind: Call, arg0: inst60000043, arg1: inst_block60000019, type: type(inst60000013)} // CHECK:STDOUT: inst60000049: {kind: NameRef, arg0: name(Cpp), arg1: inst60000011, type: type(inst(NamespaceType))} // CHECK:STDOUT: inst6000004A: {kind: NameRef, arg0: name3, arg1: inst6000002A, type: type(inst60000029)} // CHECK:STDOUT: inst6000004B: {kind: NameRef, arg0: name(Cpp), arg1: inst60000011, type: type(inst(NamespaceType))} @@ -199,7 +199,7 @@ fn G(x: Cpp.X) { // CHECK:STDOUT: inst60000052: {kind: AcquireValue, arg0: inst60000051, type: type(inst60000015)} // CHECK:STDOUT: inst60000053: {kind: ValueAsRef, arg0: inst60000052, type: type(inst60000015)} // CHECK:STDOUT: inst60000054: {kind: AddrOf, arg0: inst60000053, type: type(inst60000020)} -// CHECK:STDOUT: inst60000055: {kind: Call, arg0: inst60000043, arg1: inst_block60000018, type: type(inst60000013)} +// CHECK:STDOUT: inst60000055: {kind: Call, arg0: inst60000043, arg1: inst_block6000001B, type: type(inst60000013)} // CHECK:STDOUT: inst60000056: {kind: Return} // CHECK:STDOUT: constant_values: // CHECK:STDOUT: values: @@ -294,15 +294,17 @@ fn G(x: Cpp.X) { // CHECK:STDOUT: inst_block60000005: // CHECK:STDOUT: 0: inst6000001A // CHECK:STDOUT: inst_block60000006: -// CHECK:STDOUT: 0: inst6000001B +// CHECK:STDOUT: 0: inst6000001A // CHECK:STDOUT: inst_block60000007: +// CHECK:STDOUT: 0: inst6000001B +// CHECK:STDOUT: inst_block60000008: // CHECK:STDOUT: 0: inst60000019 // CHECK:STDOUT: 1: inst6000001A -// CHECK:STDOUT: inst_block60000008: +// CHECK:STDOUT: inst_block60000009: // CHECK:STDOUT: 0: inst6000001B // CHECK:STDOUT: 1: inst6000001C // CHECK:STDOUT: 2: inst60000017 -// CHECK:STDOUT: inst_block60000009: +// CHECK:STDOUT: inst_block6000000A: // CHECK:STDOUT: 0: inst60000028 // CHECK:STDOUT: 1: inst6000002C // CHECK:STDOUT: 2: inst60000033 @@ -323,41 +325,45 @@ fn G(x: Cpp.X) { // CHECK:STDOUT: 17: inst60000054 // CHECK:STDOUT: 18: inst60000055 // CHECK:STDOUT: 19: inst60000056 -// CHECK:STDOUT: inst_block6000000A: +// CHECK:STDOUT: inst_block6000000B: // CHECK:STDOUT: 0: inst60000022 // CHECK:STDOUT: 1: inst60000023 // CHECK:STDOUT: 2: inst60000025 -// CHECK:STDOUT: inst_block6000000B: {} -// CHECK:STDOUT: inst_block6000000C: -// CHECK:STDOUT: 0: inst60000039 +// CHECK:STDOUT: inst_block6000000C: {} // CHECK:STDOUT: inst_block6000000D: -// CHECK:STDOUT: 0: inst6000003A +// CHECK:STDOUT: 0: inst60000039 // CHECK:STDOUT: inst_block6000000E: -// CHECK:STDOUT: 0: inst60000038 -// CHECK:STDOUT: 1: inst60000039 +// CHECK:STDOUT: 0: inst60000039 // CHECK:STDOUT: inst_block6000000F: // CHECK:STDOUT: 0: inst6000003A -// CHECK:STDOUT: 1: inst60000037 -// CHECK:STDOUT: inst_block60000010: {} +// CHECK:STDOUT: inst_block60000010: +// CHECK:STDOUT: 0: inst60000038 +// CHECK:STDOUT: 1: inst60000039 // CHECK:STDOUT: inst_block60000011: -// CHECK:STDOUT: 0: inst60000041 -// CHECK:STDOUT: inst_block60000012: -// CHECK:STDOUT: 0: inst60000042 +// CHECK:STDOUT: 0: inst6000003A +// CHECK:STDOUT: 1: inst60000037 +// CHECK:STDOUT: inst_block60000012: {} // CHECK:STDOUT: inst_block60000013: +// CHECK:STDOUT: 0: inst60000041 +// CHECK:STDOUT: inst_block60000014: +// CHECK:STDOUT: 0: inst60000041 +// CHECK:STDOUT: inst_block60000015: +// CHECK:STDOUT: 0: inst60000042 +// CHECK:STDOUT: inst_block60000016: // CHECK:STDOUT: 0: inst60000040 // CHECK:STDOUT: 1: inst60000041 -// CHECK:STDOUT: inst_block60000014: +// CHECK:STDOUT: inst_block60000017: // CHECK:STDOUT: 0: inst60000042 // CHECK:STDOUT: 1: inst6000003E -// CHECK:STDOUT: inst_block60000015: -// CHECK:STDOUT: 0: inst60000036 -// CHECK:STDOUT: inst_block60000016: -// CHECK:STDOUT: 0: inst60000047 -// CHECK:STDOUT: inst_block60000017: -// CHECK:STDOUT: 0: inst60000052 // CHECK:STDOUT: inst_block60000018: -// CHECK:STDOUT: 0: inst60000054 +// CHECK:STDOUT: 0: inst60000036 // CHECK:STDOUT: inst_block60000019: +// CHECK:STDOUT: 0: inst60000047 +// CHECK:STDOUT: inst_block6000001A: +// CHECK:STDOUT: 0: inst60000052 +// CHECK:STDOUT: inst_block6000001B: +// CHECK:STDOUT: 0: inst60000054 +// CHECK:STDOUT: inst_block6000001C: // CHECK:STDOUT: 0: instF // CHECK:STDOUT: 1: inst60000010 // CHECK:STDOUT: 2: inst6000001D diff --git a/toolchain/check/testdata/basics/raw_sem_ir/multifile.carbon b/toolchain/check/testdata/basics/raw_sem_ir/multifile.carbon index 84d0670419a7..48e6fdaf812c 100644 --- a/toolchain/check/testdata/basics/raw_sem_ir/multifile.carbon +++ b/toolchain/check/testdata/basics/raw_sem_ir/multifile.carbon @@ -40,7 +40,7 @@ fn B() { // CHECK:STDOUT: entity_names: {} // CHECK:STDOUT: cpp_global_vars: {} // CHECK:STDOUT: functions: -// CHECK:STDOUT: function60000000: {name: name0, parent_scope: name_scope0, call_params_id: inst_block_empty, body: [inst_block60000005]} +// CHECK:STDOUT: function60000000: {name: name0, parent_scope: name_scope0, call_param_patterns_id: inst_block_empty, call_params_id: inst_block_empty, body: [inst_block60000005]} // CHECK:STDOUT: classes: {} // CHECK:STDOUT: generics: {} // CHECK:STDOUT: specifics: {} @@ -105,8 +105,8 @@ fn B() { // CHECK:STDOUT: entity_name50000000: {name: name1, parent_scope: name_scope50000001, index: -1, is_template: 0} // CHECK:STDOUT: cpp_global_vars: {} // CHECK:STDOUT: functions: -// CHECK:STDOUT: function50000000: {name: name0, parent_scope: name_scope0, call_params_id: inst_block_empty, body: [inst_block50000005]} -// CHECK:STDOUT: function50000001: {name: name1, parent_scope: name_scope50000001} +// CHECK:STDOUT: function50000000: {name: name0, parent_scope: name_scope0, call_param_patterns_id: inst_block_empty, call_params_id: inst_block_empty, body: [inst_block50000005]} +// CHECK:STDOUT: function50000001: {name: name1, parent_scope: name_scope50000001, call_param_patterns_id: inst_block_empty} // CHECK:STDOUT: classes: {} // CHECK:STDOUT: generics: {} // CHECK:STDOUT: specifics: {} diff --git a/toolchain/check/testdata/basics/raw_sem_ir/multifile_with_textual_ir.carbon b/toolchain/check/testdata/basics/raw_sem_ir/multifile_with_textual_ir.carbon index df4dbef86d83..0eb792f2e704 100644 --- a/toolchain/check/testdata/basics/raw_sem_ir/multifile_with_textual_ir.carbon +++ b/toolchain/check/testdata/basics/raw_sem_ir/multifile_with_textual_ir.carbon @@ -40,7 +40,7 @@ fn B() { // CHECK:STDOUT: entity_names: {} // CHECK:STDOUT: cpp_global_vars: {} // CHECK:STDOUT: functions: -// CHECK:STDOUT: function60000000: {name: name0, parent_scope: name_scope0, call_params_id: inst_block_empty, body: [inst_block60000005]} +// CHECK:STDOUT: function60000000: {name: name0, parent_scope: name_scope0, call_param_patterns_id: inst_block_empty, call_params_id: inst_block_empty, body: [inst_block60000005]} // CHECK:STDOUT: classes: {} // CHECK:STDOUT: generics: {} // CHECK:STDOUT: specifics: {} @@ -124,8 +124,8 @@ fn B() { // CHECK:STDOUT: entity_name50000000: {name: name1, parent_scope: name_scope50000001, index: -1, is_template: 0} // CHECK:STDOUT: cpp_global_vars: {} // CHECK:STDOUT: functions: -// CHECK:STDOUT: function50000000: {name: name0, parent_scope: name_scope0, call_params_id: inst_block_empty, body: [inst_block50000005]} -// CHECK:STDOUT: function50000001: {name: name1, parent_scope: name_scope50000001} +// CHECK:STDOUT: function50000000: {name: name0, parent_scope: name_scope0, call_param_patterns_id: inst_block_empty, call_params_id: inst_block_empty, body: [inst_block50000005]} +// CHECK:STDOUT: function50000001: {name: name1, parent_scope: name_scope50000001, call_param_patterns_id: inst_block_empty} // CHECK:STDOUT: classes: {} // CHECK:STDOUT: generics: {} // CHECK:STDOUT: specifics: {} diff --git a/toolchain/check/testdata/basics/raw_sem_ir/one_file.carbon b/toolchain/check/testdata/basics/raw_sem_ir/one_file.carbon index 76a250dbea96..f5d134dea3ea 100644 --- a/toolchain/check/testdata/basics/raw_sem_ir/one_file.carbon +++ b/toolchain/check/testdata/basics/raw_sem_ir/one_file.carbon @@ -314,51 +314,51 @@ fn Foo[T:! type](p: T*) -> (T*, ()) { // CHECK:STDOUT: entity_name6000003E: {name: name1, parent_scope: name_scope, index: 0, is_template: 0} // CHECK:STDOUT: cpp_global_vars: {} // CHECK:STDOUT: functions: -// CHECK:STDOUT: function60000000: {name: name0, parent_scope: name_scope0, call_params_id: inst_block60000010, return_type_inst_id: inst6000002F, return_form_inst_id: inst60000031, return_patterns_id: inst_block6000000F, body: [inst_block60000017]} -// CHECK:STDOUT: function60000001: {name: name4, parent_scope: name_scope60000002, return_type_inst_id: inst60000061, return_form_inst_id: inst60000062, return_patterns_id: inst_block6000001B} -// CHECK:STDOUT: function60000002: {name: name4, parent_scope: name_scope60000003, return_type_inst_id: inst6000007A, return_form_inst_id: inst6000007B, return_patterns_id: inst_block60000025} -// CHECK:STDOUT: function60000003: {name: name4, parent_scope: name_scope60000008, return_type_inst_id: inst600000BF, return_form_inst_id: inst600000C0, return_patterns_id: inst_block60000039} -// CHECK:STDOUT: function60000004: {name: name4, parent_scope: name_scope6000000B, return_type_inst_id: inst600000E4, return_form_inst_id: inst600000E5, return_patterns_id: inst_block60000046} -// CHECK:STDOUT: function60000005: {name: name4, parent_scope: name_scope6000000C, return_type_inst_id: inst60000124, return_form_inst_id: inst60000125, return_patterns_id: inst_block6000005F} +// CHECK:STDOUT: function60000000: {name: name0, parent_scope: name_scope0, call_param_patterns_id: inst_block60000010, call_params_id: inst_block60000011, return_type_inst_id: inst6000002F, return_form_inst_id: inst60000031, return_patterns_id: inst_block6000000F, body: [inst_block60000018]} +// CHECK:STDOUT: function60000001: {name: name4, parent_scope: name_scope60000002, call_param_patterns_id: inst_block6000001B, return_type_inst_id: inst60000061, return_form_inst_id: inst60000062, return_patterns_id: inst_block6000001D} +// CHECK:STDOUT: function60000002: {name: name4, parent_scope: name_scope60000003, call_param_patterns_id: inst_block60000026, return_type_inst_id: inst6000007A, return_form_inst_id: inst6000007B, return_patterns_id: inst_block60000028} +// CHECK:STDOUT: function60000003: {name: name4, parent_scope: name_scope60000008, call_param_patterns_id: inst_block6000003B, return_type_inst_id: inst600000BF, return_form_inst_id: inst600000C0, return_patterns_id: inst_block6000003D} +// CHECK:STDOUT: function60000004: {name: name4, parent_scope: name_scope6000000B, call_param_patterns_id: inst_block60000049, return_type_inst_id: inst600000E4, return_form_inst_id: inst600000E5, return_patterns_id: inst_block6000004B} +// CHECK:STDOUT: function60000005: {name: name4, parent_scope: name_scope6000000C, call_param_patterns_id: inst_block60000063, return_type_inst_id: inst60000124, return_form_inst_id: inst60000125, return_patterns_id: inst_block60000065} // CHECK:STDOUT: classes: {} // CHECK:STDOUT: generics: -// CHECK:STDOUT: generic60000000: {decl: inst6000003C, bindings: inst_block60000013} -// CHECK:STDOUT: generic60000001: {decl: inst60000057, bindings: inst_block6000001C} -// CHECK:STDOUT: generic60000002: {decl: inst6000006A, bindings: inst_block6000002D} -// CHECK:STDOUT: generic60000003: {decl: inst60000071, bindings: inst_block60000026} -// CHECK:STDOUT: generic60000004: {decl: inst600000AC, bindings: inst_block60000035} -// CHECK:STDOUT: generic60000005: {decl: inst600000B7, bindings: inst_block6000003A} -// CHECK:STDOUT: generic60000006: {decl: inst600000D2, bindings: inst_block60000051} -// CHECK:STDOUT: generic60000007: {decl: inst600000D9, bindings: inst_block60000047} -// CHECK:STDOUT: generic60000008: {decl: inst60000112, bindings: inst_block6000006B} -// CHECK:STDOUT: generic60000009: {decl: inst60000119, bindings: inst_block60000060} +// CHECK:STDOUT: generic60000000: {decl: inst6000003C, bindings: inst_block60000014} +// CHECK:STDOUT: generic60000001: {decl: inst60000057, bindings: inst_block6000001E} +// CHECK:STDOUT: generic60000002: {decl: inst6000006A, bindings: inst_block60000030} +// CHECK:STDOUT: generic60000003: {decl: inst60000071, bindings: inst_block60000029} +// CHECK:STDOUT: generic60000004: {decl: inst600000AC, bindings: inst_block60000038} +// CHECK:STDOUT: generic60000005: {decl: inst600000B7, bindings: inst_block6000003E} +// CHECK:STDOUT: generic60000006: {decl: inst600000D2, bindings: inst_block60000056} +// CHECK:STDOUT: generic60000007: {decl: inst600000D9, bindings: inst_block6000004C} +// CHECK:STDOUT: generic60000008: {decl: inst60000112, bindings: inst_block60000071} +// CHECK:STDOUT: generic60000009: {decl: inst60000119, bindings: inst_block60000066} // CHECK:STDOUT: specifics: -// CHECK:STDOUT: specific60000000: {generic: generic60000000, args: inst_block60000014} -// CHECK:STDOUT: specific60000001: {generic: generic60000001, args: inst_block6000001E} -// CHECK:STDOUT: specific60000002: {generic: generic60000002, args: inst_block60000021} -// CHECK:STDOUT: specific60000003: {generic: generic60000001, args: inst_block60000021} -// CHECK:STDOUT: specific60000004: {generic: generic60000003, args: inst_block60000021} -// CHECK:STDOUT: specific60000005: {generic: generic60000001, args: inst_block60000029} -// CHECK:STDOUT: specific60000006: {generic: generic60000002, args: inst_block6000002E} -// CHECK:STDOUT: specific60000007: {generic: generic60000004, args: inst_block60000014} -// CHECK:STDOUT: specific60000008: {generic: generic60000004, args: inst_block60000036} -// CHECK:STDOUT: specific60000009: {generic: generic60000005, args: inst_block60000014} -// CHECK:STDOUT: specific6000000A: {generic: generic60000006, args: inst_block60000041} -// CHECK:STDOUT: specific6000000B: {generic: generic60000001, args: inst_block6000004A} -// CHECK:STDOUT: specific6000000C: {generic: generic60000007, args: inst_block60000041} -// CHECK:STDOUT: specific6000000D: {generic: generic60000001, args: inst_block6000004C} -// CHECK:STDOUT: specific6000000E: {generic: generic60000001, args: inst_block6000004D} -// CHECK:STDOUT: specific6000000F: {generic: generic60000006, args: inst_block60000052} -// CHECK:STDOUT: specific60000010: {generic: generic60000008, args: inst_block6000005A} -// CHECK:STDOUT: specific60000011: {generic: generic60000001, args: inst_block60000063} -// CHECK:STDOUT: specific60000012: {generic: generic60000009, args: inst_block6000005A} -// CHECK:STDOUT: specific60000013: {generic: generic60000001, args: inst_block60000065} -// CHECK:STDOUT: specific60000014: {generic: generic60000001, args: inst_block60000066} -// CHECK:STDOUT: specific60000015: {generic: generic60000001, args: inst_block60000067} -// CHECK:STDOUT: specific60000016: {generic: generic60000008, args: inst_block6000006C} -// CHECK:STDOUT: specific60000017: {generic: generic60000004, args: inst_block60000073} -// CHECK:STDOUT: specific60000018: {generic: generic60000001, args: inst_block60000076} -// CHECK:STDOUT: specific60000019: {generic: generic60000001, args: inst_block60000078} +// CHECK:STDOUT: specific60000000: {generic: generic60000000, args: inst_block60000015} +// CHECK:STDOUT: specific60000001: {generic: generic60000001, args: inst_block60000020} +// CHECK:STDOUT: specific60000002: {generic: generic60000002, args: inst_block60000023} +// CHECK:STDOUT: specific60000003: {generic: generic60000001, args: inst_block60000023} +// CHECK:STDOUT: specific60000004: {generic: generic60000003, args: inst_block60000023} +// CHECK:STDOUT: specific60000005: {generic: generic60000001, args: inst_block6000002C} +// CHECK:STDOUT: specific60000006: {generic: generic60000002, args: inst_block60000031} +// CHECK:STDOUT: specific60000007: {generic: generic60000004, args: inst_block60000015} +// CHECK:STDOUT: specific60000008: {generic: generic60000004, args: inst_block60000039} +// CHECK:STDOUT: specific60000009: {generic: generic60000005, args: inst_block60000015} +// CHECK:STDOUT: specific6000000A: {generic: generic60000006, args: inst_block60000045} +// CHECK:STDOUT: specific6000000B: {generic: generic60000001, args: inst_block6000004F} +// CHECK:STDOUT: specific6000000C: {generic: generic60000007, args: inst_block60000045} +// CHECK:STDOUT: specific6000000D: {generic: generic60000001, args: inst_block60000051} +// CHECK:STDOUT: specific6000000E: {generic: generic60000001, args: inst_block60000052} +// CHECK:STDOUT: specific6000000F: {generic: generic60000006, args: inst_block60000057} +// CHECK:STDOUT: specific60000010: {generic: generic60000008, args: inst_block6000005F} +// CHECK:STDOUT: specific60000011: {generic: generic60000001, args: inst_block60000069} +// CHECK:STDOUT: specific60000012: {generic: generic60000009, args: inst_block6000005F} +// CHECK:STDOUT: specific60000013: {generic: generic60000001, args: inst_block6000006B} +// CHECK:STDOUT: specific60000014: {generic: generic60000001, args: inst_block6000006C} +// CHECK:STDOUT: specific60000015: {generic: generic60000001, args: inst_block6000006D} +// CHECK:STDOUT: specific60000016: {generic: generic60000008, args: inst_block60000072} +// CHECK:STDOUT: specific60000017: {generic: generic60000004, args: inst_block60000079} +// CHECK:STDOUT: specific60000018: {generic: generic60000001, args: inst_block6000007C} +// CHECK:STDOUT: specific60000019: {generic: generic60000001, args: inst_block6000007E} // CHECK:STDOUT: struct_type_fields: // CHECK:STDOUT: struct_type_fields_empty: {} // CHECK:STDOUT: types: @@ -450,7 +450,7 @@ fn Foo[T:! type](p: T*) -> (T*, ()) { // CHECK:STDOUT: inst60000039: {kind: SpliceBlock, arg0: inst_block60000006, arg1: inst6000001B, type: type(TypeType)} // CHECK:STDOUT: inst6000003A: {kind: OutParam, arg0: call_param1, arg1: name(ReturnSlot), type: type(symbolic_constantA)} // CHECK:STDOUT: inst6000003B: {kind: ReturnSlot, arg0: inst6000002E, arg1: inst6000003A, type: type(symbolic_constantA)} -// CHECK:STDOUT: inst6000003C: {kind: FunctionDecl, arg0: function60000000, arg1: inst_block60000012, type: type(inst6000003D)} +// CHECK:STDOUT: inst6000003C: {kind: FunctionDecl, arg0: function60000000, arg1: inst_block60000013, type: type(inst6000003D)} // CHECK:STDOUT: inst6000003D: {kind: FunctionType, arg0: function60000000, arg1: specific, type: type(TypeType)} // CHECK:STDOUT: inst6000003E: {kind: StructValue, arg0: inst_block_empty, type: type(inst6000003D)} // CHECK:STDOUT: inst6000003F: {kind: PointerType, arg0: inst6000002E, type: type(TypeType)} @@ -463,7 +463,7 @@ fn Foo[T:! type](p: T*) -> (T*, ()) { // CHECK:STDOUT: inst60000046: {kind: RequireCompleteType, arg0: inst6000002E, type: type(inst(WitnessType))} // CHECK:STDOUT: inst60000047: {kind: NameRef, arg0: name2, arg1: inst6000001E, type: type(symbolic_constant4)} // CHECK:STDOUT: inst60000048: {kind: TupleLiteral, arg0: inst_block_empty, type: type(inst60000025)} -// CHECK:STDOUT: inst60000049: {kind: TupleLiteral, arg0: inst_block60000018, type: type(symbolic_constantA)} +// CHECK:STDOUT: inst60000049: {kind: TupleLiteral, arg0: inst_block60000019, type: type(symbolic_constantA)} // CHECK:STDOUT: inst6000004A: {kind: RequireCompleteType, arg0: inst6000002E, type: type(inst(WitnessType))} // CHECK:STDOUT: inst6000004B: {kind: TupleAccess, arg0: inst6000003A, arg1: element0, type: type(symbolic_constant4)} // CHECK:STDOUT: inst6000004C: {kind: RequireCompleteType, arg0: inst6000001C, type: type(inst(WitnessType))} @@ -501,7 +501,7 @@ fn Foo[T:! type](p: T*) -> (T*, ()) { // CHECK:STDOUT: inst6000006C: {kind: SymbolicBindingType, arg0: entity_name60000001, arg1: inst6000006B, type: type(TypeType)} // CHECK:STDOUT: inst6000006D: {kind: ConstType, arg0: inst6000006C, type: type(TypeType)} // CHECK:STDOUT: inst6000006E: {kind: ImportRefUnloaded, arg0: import_ir_inst14, arg1: entity_name} -// CHECK:STDOUT: inst6000006F: {kind: ImplWitnessTable, arg0: inst_block60000020, arg1: impl60000000} +// CHECK:STDOUT: inst6000006F: {kind: ImplWitnessTable, arg0: inst_block60000022, arg1: impl60000000} // CHECK:STDOUT: inst60000070: {kind: ImplWitness, arg0: inst6000006F, arg1: specific60000002, type: type(inst(WitnessType))} // CHECK:STDOUT: inst60000071: {kind: FunctionDecl, arg0: function60000002, arg1: inst_block_empty, type: type(symbolic_constant60000028)} // CHECK:STDOUT: inst60000072: {kind: FunctionType, arg0: function60000002, arg1: specific60000002, type: type(TypeType)} @@ -564,7 +564,7 @@ fn Foo[T:! type](p: T*) -> (T*, ()) { // CHECK:STDOUT: inst600000AB: {kind: ImportRefLoaded, arg0: import_ir_inst43, arg1: entity_name, type: type(inst(WitnessType))} // CHECK:STDOUT: inst600000AC: {kind: ImplDecl, arg0: impl60000005, arg1: inst_block_empty} // CHECK:STDOUT: inst600000AD: {kind: ImportRefUnloaded, arg0: import_ir_inst45, arg1: entity_name} -// CHECK:STDOUT: inst600000AE: {kind: ImplWitnessTable, arg0: inst_block60000032, arg1: impl60000005} +// CHECK:STDOUT: inst600000AE: {kind: ImplWitnessTable, arg0: inst_block60000035, arg1: impl60000005} // CHECK:STDOUT: inst600000AF: {kind: ImplWitness, arg0: inst600000AE, arg1: specific60000007, type: type(inst(WitnessType))} // CHECK:STDOUT: inst600000B0: {kind: SymbolicBindingPattern, arg0: entity_name60000018, type: type(inst60000018)} // CHECK:STDOUT: inst600000B1: {kind: ImportRefLoaded, arg0: import_ir_inst48, arg1: entity_name, type: type(TypeType)} @@ -603,15 +603,15 @@ fn Foo[T:! type](p: T*) -> (T*, ()) { // CHECK:STDOUT: inst600000D2: {kind: ImplDecl, arg0: impl60000008, arg1: inst_block_empty} // CHECK:STDOUT: inst600000D3: {kind: SymbolicBinding, arg0: entity_name6000001B, arg1: inst, type: type(inst6000004F)} // CHECK:STDOUT: inst600000D4: {kind: SymbolicBindingType, arg0: entity_name6000001B, arg1: inst600000D3, type: type(TypeType)} -// CHECK:STDOUT: inst600000D5: {kind: TupleType, arg0: inst_block6000003F, type: type(TypeType)} +// CHECK:STDOUT: inst600000D5: {kind: TupleType, arg0: inst_block60000043, type: type(TypeType)} // CHECK:STDOUT: inst600000D6: {kind: ImportRefUnloaded, arg0: import_ir_inst67, arg1: entity_name} -// CHECK:STDOUT: inst600000D7: {kind: ImplWitnessTable, arg0: inst_block60000040, arg1: impl60000008} +// CHECK:STDOUT: inst600000D7: {kind: ImplWitnessTable, arg0: inst_block60000044, arg1: impl60000008} // CHECK:STDOUT: inst600000D8: {kind: ImplWitness, arg0: inst600000D7, arg1: specific6000000A, type: type(inst(WitnessType))} // CHECK:STDOUT: inst600000D9: {kind: FunctionDecl, arg0: function60000004, arg1: inst_block_empty, type: type(symbolic_constant6000007C)} // CHECK:STDOUT: inst600000DA: {kind: FunctionType, arg0: function60000004, arg1: specific6000000A, type: type(TypeType)} // CHECK:STDOUT: inst600000DB: {kind: StructValue, arg0: inst_block_empty, type: type(symbolic_constant6000007C)} -// CHECK:STDOUT: inst600000DC: {kind: TupleType, arg0: inst_block60000042, type: type(TypeType)} -// CHECK:STDOUT: inst600000DD: {kind: TupleValue, arg0: inst_block60000041, type: type(inst600000DC)} +// CHECK:STDOUT: inst600000DC: {kind: TupleType, arg0: inst_block60000046, type: type(TypeType)} +// CHECK:STDOUT: inst600000DD: {kind: TupleValue, arg0: inst_block60000045, type: type(inst600000DC)} // CHECK:STDOUT: inst600000DE: {kind: PatternType, arg0: inst600000D5, type: type(TypeType)} // CHECK:STDOUT: inst600000DF: {kind: ReturnSlotPattern, arg0: inst, type: type(symbolic_constant60000082)} // CHECK:STDOUT: inst600000E0: {kind: OutParamPattern, arg0: inst600000DF, arg1: call_param1, type: type(symbolic_constant60000082)} @@ -626,7 +626,7 @@ fn Foo[T:! type](p: T*) -> (T*, ()) { // CHECK:STDOUT: inst600000E9: {kind: SymbolicBindingType, arg0: entity_name60000001, arg1: inst600000E8, type: type(TypeType)} // CHECK:STDOUT: inst600000EA: {kind: SymbolicBinding, arg0: entity_name6000001B, arg1: inst, type: type(inst6000004F)} // CHECK:STDOUT: inst600000EB: {kind: SymbolicBindingType, arg0: entity_name6000001B, arg1: inst600000EA, type: type(TypeType)} -// CHECK:STDOUT: inst600000EC: {kind: TupleType, arg0: inst_block60000048, type: type(TypeType)} +// CHECK:STDOUT: inst600000EC: {kind: TupleType, arg0: inst_block6000004D, type: type(TypeType)} // CHECK:STDOUT: inst600000ED: {kind: PatternType, arg0: inst600000EC, type: type(TypeType)} // CHECK:STDOUT: inst600000EE: {kind: InitForm, arg0: inst600000EC, arg1: call_param1, type: type(inst(FormType))} // CHECK:STDOUT: inst600000EF: {kind: LookupImplWitness, arg0: inst600000D3, arg1: specific_interface60000000, type: type(inst(WitnessType))} @@ -656,10 +656,10 @@ fn Foo[T:! type](p: T*) -> (T*, ()) { // CHECK:STDOUT: inst60000107: {kind: ImportRefLoaded, arg0: import_ir_inst89, arg1: entity_name, type: type(inst6000004F)} // CHECK:STDOUT: inst60000108: {kind: SymbolicBinding, arg0: entity_name60000001, arg1: inst, type: type(inst6000004F)} // CHECK:STDOUT: inst60000109: {kind: SymbolicBinding, arg0: entity_name6000001B, arg1: inst, type: type(inst6000004F)} -// CHECK:STDOUT: inst6000010A: {kind: TupleValue, arg0: inst_block60000052, type: type(inst600000DC)} +// CHECK:STDOUT: inst6000010A: {kind: TupleValue, arg0: inst_block60000057, type: type(inst600000DC)} // CHECK:STDOUT: inst6000010B: {kind: SymbolicBindingType, arg0: entity_name60000001, arg1: inst60000108, type: type(TypeType)} // CHECK:STDOUT: inst6000010C: {kind: SymbolicBindingType, arg0: entity_name6000001B, arg1: inst60000109, type: type(TypeType)} -// CHECK:STDOUT: inst6000010D: {kind: TupleType, arg0: inst_block60000053, type: type(TypeType)} +// CHECK:STDOUT: inst6000010D: {kind: TupleType, arg0: inst_block60000058, type: type(TypeType)} // CHECK:STDOUT: inst6000010E: {kind: ImplWitness, arg0: inst600000D7, arg1: specific6000000F, type: type(inst(WitnessType))} // CHECK:STDOUT: inst6000010F: {kind: FunctionType, arg0: function60000004, arg1: specific6000000F, type: type(TypeType)} // CHECK:STDOUT: inst60000110: {kind: StructValue, arg0: inst_block_empty, type: type(symbolic_constant600000C1)} @@ -667,15 +667,15 @@ fn Foo[T:! type](p: T*) -> (T*, ()) { // CHECK:STDOUT: inst60000112: {kind: ImplDecl, arg0: impl60000009, arg1: inst_block_empty} // CHECK:STDOUT: inst60000113: {kind: SymbolicBinding, arg0: entity_name6000002A, arg1: inst, type: type(inst6000004F)} // CHECK:STDOUT: inst60000114: {kind: SymbolicBindingType, arg0: entity_name6000002A, arg1: inst60000113, type: type(TypeType)} -// CHECK:STDOUT: inst60000115: {kind: TupleType, arg0: inst_block60000058, type: type(TypeType)} +// CHECK:STDOUT: inst60000115: {kind: TupleType, arg0: inst_block6000005D, type: type(TypeType)} // CHECK:STDOUT: inst60000116: {kind: ImportRefUnloaded, arg0: import_ir_inst95, arg1: entity_name} -// CHECK:STDOUT: inst60000117: {kind: ImplWitnessTable, arg0: inst_block60000059, arg1: impl60000009} +// CHECK:STDOUT: inst60000117: {kind: ImplWitnessTable, arg0: inst_block6000005E, arg1: impl60000009} // CHECK:STDOUT: inst60000118: {kind: ImplWitness, arg0: inst60000117, arg1: specific60000010, type: type(inst(WitnessType))} // CHECK:STDOUT: inst60000119: {kind: FunctionDecl, arg0: function60000005, arg1: inst_block_empty, type: type(symbolic_constant600000C9)} // CHECK:STDOUT: inst6000011A: {kind: FunctionType, arg0: function60000005, arg1: specific60000010, type: type(TypeType)} // CHECK:STDOUT: inst6000011B: {kind: StructValue, arg0: inst_block_empty, type: type(symbolic_constant600000C9)} -// CHECK:STDOUT: inst6000011C: {kind: TupleType, arg0: inst_block6000005B, type: type(TypeType)} -// CHECK:STDOUT: inst6000011D: {kind: TupleValue, arg0: inst_block6000005A, type: type(inst6000011C)} +// CHECK:STDOUT: inst6000011C: {kind: TupleType, arg0: inst_block60000060, type: type(TypeType)} +// CHECK:STDOUT: inst6000011D: {kind: TupleValue, arg0: inst_block6000005F, type: type(inst6000011C)} // CHECK:STDOUT: inst6000011E: {kind: PatternType, arg0: inst60000115, type: type(TypeType)} // CHECK:STDOUT: inst6000011F: {kind: ReturnSlotPattern, arg0: inst, type: type(symbolic_constant600000CF)} // CHECK:STDOUT: inst60000120: {kind: OutParamPattern, arg0: inst6000011F, arg1: call_param1, type: type(symbolic_constant600000CF)} @@ -693,7 +693,7 @@ fn Foo[T:! type](p: T*) -> (T*, ()) { // CHECK:STDOUT: inst6000012C: {kind: SymbolicBindingType, arg0: entity_name6000001B, arg1: inst6000012B, type: type(TypeType)} // CHECK:STDOUT: inst6000012D: {kind: SymbolicBinding, arg0: entity_name6000002A, arg1: inst, type: type(inst6000004F)} // CHECK:STDOUT: inst6000012E: {kind: SymbolicBindingType, arg0: entity_name6000002A, arg1: inst6000012D, type: type(TypeType)} -// CHECK:STDOUT: inst6000012F: {kind: TupleType, arg0: inst_block60000061, type: type(TypeType)} +// CHECK:STDOUT: inst6000012F: {kind: TupleType, arg0: inst_block60000067, type: type(TypeType)} // CHECK:STDOUT: inst60000130: {kind: PatternType, arg0: inst6000012F, type: type(TypeType)} // CHECK:STDOUT: inst60000131: {kind: InitForm, arg0: inst6000012F, arg1: call_param1, type: type(inst(FormType))} // CHECK:STDOUT: inst60000132: {kind: LookupImplWitness, arg0: inst60000113, arg1: specific_interface60000000, type: type(inst(WitnessType))} @@ -731,11 +731,11 @@ fn Foo[T:! type](p: T*) -> (T*, ()) { // CHECK:STDOUT: inst60000152: {kind: SymbolicBinding, arg0: entity_name60000001, arg1: inst, type: type(inst6000004F)} // CHECK:STDOUT: inst60000153: {kind: SymbolicBinding, arg0: entity_name6000001B, arg1: inst, type: type(inst6000004F)} // CHECK:STDOUT: inst60000154: {kind: SymbolicBinding, arg0: entity_name6000002A, arg1: inst, type: type(inst6000004F)} -// CHECK:STDOUT: inst60000155: {kind: TupleValue, arg0: inst_block6000006C, type: type(inst6000011C)} +// CHECK:STDOUT: inst60000155: {kind: TupleValue, arg0: inst_block60000072, type: type(inst6000011C)} // CHECK:STDOUT: inst60000156: {kind: SymbolicBindingType, arg0: entity_name60000001, arg1: inst60000152, type: type(TypeType)} // CHECK:STDOUT: inst60000157: {kind: SymbolicBindingType, arg0: entity_name6000001B, arg1: inst60000153, type: type(TypeType)} // CHECK:STDOUT: inst60000158: {kind: SymbolicBindingType, arg0: entity_name6000002A, arg1: inst60000154, type: type(TypeType)} -// CHECK:STDOUT: inst60000159: {kind: TupleType, arg0: inst_block6000006D, type: type(TypeType)} +// CHECK:STDOUT: inst60000159: {kind: TupleType, arg0: inst_block60000073, type: type(TypeType)} // CHECK:STDOUT: inst6000015A: {kind: ImplWitness, arg0: inst60000117, arg1: specific60000016, type: type(inst(WitnessType))} // CHECK:STDOUT: inst6000015B: {kind: FunctionType, arg0: function60000005, arg1: specific60000016, type: type(TypeType)} // CHECK:STDOUT: inst6000015C: {kind: StructValue, arg0: inst_block_empty, type: type(symbolic_constant60000121)} @@ -744,11 +744,11 @@ fn Foo[T:! type](p: T*) -> (T*, ()) { // CHECK:STDOUT: inst6000015F: {kind: RequireSpecificDefinition, arg0: specific60000017, type: type(inst(RequireSpecificDefinitionType))} // CHECK:STDOUT: inst60000160: {kind: LookupImplWitness, arg0: inst6000001C, arg1: specific_interface60000000, type: type(inst(WitnessType))} // CHECK:STDOUT: inst60000161: {kind: LookupImplWitness, arg0: inst6000001D, arg1: specific_interface60000000, type: type(inst(WitnessType))} -// CHECK:STDOUT: inst60000162: {kind: FacetValue, arg0: inst6000001C, arg1: inst_block60000074, type: type(inst6000004F)} +// CHECK:STDOUT: inst60000162: {kind: FacetValue, arg0: inst6000001C, arg1: inst_block6000007A, type: type(inst6000004F)} // CHECK:STDOUT: inst60000163: {kind: FunctionTypeWithSelfType, arg0: inst60000058, arg1: inst60000162, type: type(TypeType)} // CHECK:STDOUT: inst60000164: {kind: ImplWitnessAccess, arg0: inst60000160, arg1: element0, type: type(symbolic_constant6000012C)} // CHECK:STDOUT: inst60000165: {kind: ImplWitnessAccess, arg0: inst60000160, arg1: element0, type: type(symbolic_constant60000129)} -// CHECK:STDOUT: inst60000166: {kind: FacetValue, arg0: inst6000001D, arg1: inst_block60000075, type: type(inst6000004F)} +// CHECK:STDOUT: inst60000166: {kind: FacetValue, arg0: inst6000001D, arg1: inst_block6000007B, type: type(inst6000004F)} // CHECK:STDOUT: inst60000167: {kind: FunctionTypeWithSelfType, arg0: inst60000058, arg1: inst60000166, type: type(TypeType)} // CHECK:STDOUT: inst60000168: {kind: ImplWitnessAccess, arg0: inst60000161, arg1: element0, type: type(symbolic_constant6000012C)} // CHECK:STDOUT: inst60000169: {kind: BoundMethod, arg0: inst60000047, arg1: inst60000164, type: type(inst(BoundMethodType))} @@ -757,12 +757,12 @@ fn Foo[T:! type](p: T*) -> (T*, ()) { // CHECK:STDOUT: inst6000016C: {kind: SpecificImplFunction, arg0: inst60000168, arg1: specific60000019, type: type(inst(SpecificFunctionType))} // CHECK:STDOUT: inst6000016D: {kind: BoundMethod, arg0: inst60000047, arg1: inst6000016A, type: type(inst(BoundMethodType))} // CHECK:STDOUT: inst6000016E: {kind: RequireCompleteType, arg0: inst6000001C, type: type(inst(WitnessType))} -// CHECK:STDOUT: inst6000016F: {kind: Call, arg0: inst6000016D, arg1: inst_block60000079, type: type(symbolic_constant4)} +// CHECK:STDOUT: inst6000016F: {kind: Call, arg0: inst6000016D, arg1: inst_block6000007F, type: type(symbolic_constant4)} // CHECK:STDOUT: inst60000170: {kind: InitializeFrom, arg0: inst6000016F, arg1: inst6000004B, type: type(symbolic_constant4)} // CHECK:STDOUT: inst60000171: {kind: TupleAccess, arg0: inst6000003A, arg1: element1, type: type(inst60000025)} // CHECK:STDOUT: inst60000172: {kind: TupleInit, arg0: inst_block_empty, arg1: inst60000171, type: type(inst60000025)} // CHECK:STDOUT: inst60000173: {kind: Converted, arg0: inst60000048, arg1: inst60000172, type: type(inst60000025)} -// CHECK:STDOUT: inst60000174: {kind: TupleInit, arg0: inst_block6000007A, arg1: inst6000003A, type: type(symbolic_constantA)} +// CHECK:STDOUT: inst60000174: {kind: TupleInit, arg0: inst_block60000080, arg1: inst6000003A, type: type(symbolic_constantA)} // CHECK:STDOUT: inst60000175: {kind: Converted, arg0: inst60000049, arg1: inst60000174, type: type(symbolic_constantA)} // CHECK:STDOUT: inst60000176: {kind: ReturnExpr, arg0: inst60000175, arg1: inst6000003A} // CHECK:STDOUT: constant_values: @@ -1567,15 +1567,18 @@ fn Foo[T:! type](p: T*) -> (T*, ()) { // CHECK:STDOUT: inst_block6000000F: // CHECK:STDOUT: 0: inst60000037 // CHECK:STDOUT: inst_block60000010: +// CHECK:STDOUT: 0: inst60000022 +// CHECK:STDOUT: 1: inst60000037 +// CHECK:STDOUT: inst_block60000011: // CHECK:STDOUT: 0: inst60000038 // CHECK:STDOUT: 1: inst6000003A -// CHECK:STDOUT: inst_block60000011: +// CHECK:STDOUT: inst_block60000012: // CHECK:STDOUT: 0: inst60000019 // CHECK:STDOUT: 1: inst60000020 // CHECK:STDOUT: 2: inst60000022 // CHECK:STDOUT: 3: inst60000035 // CHECK:STDOUT: 4: inst60000037 -// CHECK:STDOUT: inst_block60000012: +// CHECK:STDOUT: inst_block60000013: // CHECK:STDOUT: 0: inst60000023 // CHECK:STDOUT: 1: inst60000024 // CHECK:STDOUT: 2: inst60000026 @@ -1590,11 +1593,11 @@ fn Foo[T:! type](p: T*) -> (T*, ()) { // CHECK:STDOUT: 11: inst6000001E // CHECK:STDOUT: 12: inst6000003A // CHECK:STDOUT: 13: inst6000003B -// CHECK:STDOUT: inst_block60000013: -// CHECK:STDOUT: 0: inst60000015 // CHECK:STDOUT: inst_block60000014: -// CHECK:STDOUT: 0: inst60000016 +// CHECK:STDOUT: 0: inst60000015 // CHECK:STDOUT: inst_block60000015: +// CHECK:STDOUT: 0: inst60000016 +// CHECK:STDOUT: inst_block60000016: // CHECK:STDOUT: 0: inst60000017 // CHECK:STDOUT: 1: inst6000001D // CHECK:STDOUT: 2: inst60000021 @@ -1602,7 +1605,7 @@ fn Foo[T:! type](p: T*) -> (T*, ()) { // CHECK:STDOUT: 4: inst60000030 // CHECK:STDOUT: 5: inst60000033 // CHECK:STDOUT: 6: inst60000036 -// CHECK:STDOUT: inst_block60000016: +// CHECK:STDOUT: inst_block60000017: // CHECK:STDOUT: 0: inst60000016 // CHECK:STDOUT: 1: inst6000001C // CHECK:STDOUT: 2: inst6000001F @@ -1610,7 +1613,7 @@ fn Foo[T:! type](p: T*) -> (T*, ()) { // CHECK:STDOUT: 4: inst6000002E // CHECK:STDOUT: 5: inst60000032 // CHECK:STDOUT: 6: inst60000034 -// CHECK:STDOUT: inst_block60000017: +// CHECK:STDOUT: inst_block60000018: // CHECK:STDOUT: 0: inst60000047 // CHECK:STDOUT: 1: inst60000048 // CHECK:STDOUT: 2: inst60000049 @@ -1627,139 +1630,148 @@ fn Foo[T:! type](p: T*) -> (T*, ()) { // CHECK:STDOUT: 13: inst60000174 // CHECK:STDOUT: 14: inst60000175 // CHECK:STDOUT: 15: inst60000176 -// CHECK:STDOUT: inst_block60000018: +// CHECK:STDOUT: inst_block60000019: // CHECK:STDOUT: 0: inst60000047 // CHECK:STDOUT: 1: inst60000048 -// CHECK:STDOUT: inst_block60000019: -// CHECK:STDOUT: 0: inst60000053 // CHECK:STDOUT: inst_block6000001A: -// CHECK:STDOUT: 0: inst6000005F +// CHECK:STDOUT: 0: inst60000053 // CHECK:STDOUT: inst_block6000001B: -// CHECK:STDOUT: 0: inst6000005D +// CHECK:STDOUT: 0: inst6000005F +// CHECK:STDOUT: 1: inst6000005D // CHECK:STDOUT: inst_block6000001C: -// CHECK:STDOUT: 0: inst60000063 +// CHECK:STDOUT: 0: inst6000005F // CHECK:STDOUT: inst_block6000001D: +// CHECK:STDOUT: 0: inst6000005D +// CHECK:STDOUT: inst_block6000001E: +// CHECK:STDOUT: 0: inst60000063 +// CHECK:STDOUT: inst_block6000001F: // CHECK:STDOUT: 0: inst60000064 // CHECK:STDOUT: 1: inst60000065 // CHECK:STDOUT: 2: inst60000066 // CHECK:STDOUT: 3: inst60000067 -// CHECK:STDOUT: inst_block6000001E: +// CHECK:STDOUT: inst_block60000020: // CHECK:STDOUT: 0: inst60000050 -// CHECK:STDOUT: inst_block6000001F: +// CHECK:STDOUT: inst_block60000021: // CHECK:STDOUT: 0: inst60000050 // CHECK:STDOUT: 1: inst6000005A // CHECK:STDOUT: 2: inst6000005B // CHECK:STDOUT: 3: inst60000060 -// CHECK:STDOUT: inst_block60000020: -// CHECK:STDOUT: 0: inst6000006E -// CHECK:STDOUT: inst_block60000021: -// CHECK:STDOUT: 0: inst6000006B // CHECK:STDOUT: inst_block60000022: +// CHECK:STDOUT: 0: inst6000006E +// CHECK:STDOUT: inst_block60000023: +// CHECK:STDOUT: 0: inst6000006B +// CHECK:STDOUT: inst_block60000024: // CHECK:STDOUT: 0: inst6000006B // CHECK:STDOUT: 1: inst6000006C // CHECK:STDOUT: 2: inst6000006D // CHECK:STDOUT: 3: inst60000070 -// CHECK:STDOUT: inst_block60000023: +// CHECK:STDOUT: inst_block60000025: // CHECK:STDOUT: 0: inst60000072 // CHECK:STDOUT: 1: inst60000073 -// CHECK:STDOUT: inst_block60000024: -// CHECK:STDOUT: 0: inst60000078 -// CHECK:STDOUT: inst_block60000025: -// CHECK:STDOUT: 0: inst60000076 // CHECK:STDOUT: inst_block60000026: -// CHECK:STDOUT: 0: inst6000007C +// CHECK:STDOUT: 0: inst60000078 +// CHECK:STDOUT: 1: inst60000076 // CHECK:STDOUT: inst_block60000027: +// CHECK:STDOUT: 0: inst60000078 +// CHECK:STDOUT: inst_block60000028: +// CHECK:STDOUT: 0: inst60000076 +// CHECK:STDOUT: inst_block60000029: +// CHECK:STDOUT: 0: inst6000007C +// CHECK:STDOUT: inst_block6000002A: // CHECK:STDOUT: 0: inst6000007D // CHECK:STDOUT: 1: inst6000007E // CHECK:STDOUT: 2: inst6000007F // CHECK:STDOUT: 3: inst60000080 // CHECK:STDOUT: 4: inst60000081 -// CHECK:STDOUT: inst_block60000028: +// CHECK:STDOUT: inst_block6000002B: // CHECK:STDOUT: 0: inst6000006B // CHECK:STDOUT: 1: inst6000006C // CHECK:STDOUT: 2: inst60000087 // CHECK:STDOUT: 3: inst60000086 -// CHECK:STDOUT: inst_block60000029: +// CHECK:STDOUT: inst_block6000002C: // CHECK:STDOUT: 0: inst6000007D -// CHECK:STDOUT: inst_block6000002A: +// CHECK:STDOUT: inst_block6000002D: // CHECK:STDOUT: 0: inst6000008A // CHECK:STDOUT: 1: inst6000008B // CHECK:STDOUT: 2: inst6000008C // CHECK:STDOUT: 3: inst6000008D // CHECK:STDOUT: 4: inst6000008E // CHECK:STDOUT: 5: inst6000008F -// CHECK:STDOUT: inst_block6000002B: +// CHECK:STDOUT: inst_block6000002E: // CHECK:STDOUT: 0: inst6000006B // CHECK:STDOUT: 1: inst6000006C // CHECK:STDOUT: 2: inst6000006D // CHECK:STDOUT: 3: inst60000074 // CHECK:STDOUT: 4: inst60000079 -// CHECK:STDOUT: inst_block6000002C: -// CHECK:STDOUT: 0: inst60000091 -// CHECK:STDOUT: inst_block6000002D: -// CHECK:STDOUT: 0: inst60000094 -// CHECK:STDOUT: inst_block6000002E: -// CHECK:STDOUT: 0: inst60000095 // CHECK:STDOUT: inst_block6000002F: +// CHECK:STDOUT: 0: inst60000091 +// CHECK:STDOUT: inst_block60000030: +// CHECK:STDOUT: 0: inst60000094 +// CHECK:STDOUT: inst_block60000031: +// CHECK:STDOUT: 0: inst60000095 +// CHECK:STDOUT: inst_block60000032: // CHECK:STDOUT: 0: inst60000095 // CHECK:STDOUT: 1: inst60000096 // CHECK:STDOUT: 2: inst60000097 // CHECK:STDOUT: 3: inst60000098 -// CHECK:STDOUT: inst_block60000030: +// CHECK:STDOUT: inst_block60000033: // CHECK:STDOUT: 0: inst60000095 -// CHECK:STDOUT: inst_block60000031: +// CHECK:STDOUT: inst_block60000034: // CHECK:STDOUT: 0: inst60000099 // CHECK:STDOUT: 1: inst6000009A -// CHECK:STDOUT: inst_block60000032: +// CHECK:STDOUT: inst_block60000035: // CHECK:STDOUT: 0: inst600000AD -// CHECK:STDOUT: inst_block60000033: +// CHECK:STDOUT: inst_block60000036: // CHECK:STDOUT: 0: inst60000016 // CHECK:STDOUT: 1: inst6000001C // CHECK:STDOUT: 2: inst600000AF -// CHECK:STDOUT: inst_block60000034: -// CHECK:STDOUT: 0: inst600000B0 -// CHECK:STDOUT: inst_block60000035: -// CHECK:STDOUT: 0: inst600000B3 -// CHECK:STDOUT: inst_block60000036: -// CHECK:STDOUT: 0: inst600000B4 // CHECK:STDOUT: inst_block60000037: +// CHECK:STDOUT: 0: inst600000B0 +// CHECK:STDOUT: inst_block60000038: +// CHECK:STDOUT: 0: inst600000B3 +// CHECK:STDOUT: inst_block60000039: +// CHECK:STDOUT: 0: inst600000B4 +// CHECK:STDOUT: inst_block6000003A: // CHECK:STDOUT: 0: inst600000B4 // CHECK:STDOUT: 1: inst600000B5 // CHECK:STDOUT: 2: inst600000B6 -// CHECK:STDOUT: inst_block60000038: -// CHECK:STDOUT: 0: inst600000BD -// CHECK:STDOUT: inst_block60000039: -// CHECK:STDOUT: 0: inst600000BB -// CHECK:STDOUT: inst_block6000003A: -// CHECK:STDOUT: 0: inst600000C1 // CHECK:STDOUT: inst_block6000003B: +// CHECK:STDOUT: 0: inst600000BD +// CHECK:STDOUT: 1: inst600000BB +// CHECK:STDOUT: inst_block6000003C: +// CHECK:STDOUT: 0: inst600000BD +// CHECK:STDOUT: inst_block6000003D: +// CHECK:STDOUT: 0: inst600000BB +// CHECK:STDOUT: inst_block6000003E: +// CHECK:STDOUT: 0: inst600000C1 +// CHECK:STDOUT: inst_block6000003F: // CHECK:STDOUT: 0: inst600000C2 // CHECK:STDOUT: 1: inst600000C3 // CHECK:STDOUT: 2: inst600000C4 // CHECK:STDOUT: 3: inst600000C5 -// CHECK:STDOUT: inst_block6000003C: +// CHECK:STDOUT: inst_block60000040: // CHECK:STDOUT: 0: inst60000016 // CHECK:STDOUT: 1: inst6000001C // CHECK:STDOUT: 2: inst6000001F // CHECK:STDOUT: 3: inst600000BE -// CHECK:STDOUT: inst_block6000003D: +// CHECK:STDOUT: inst_block60000041: // CHECK:STDOUT: 0: inst600000B4 -// CHECK:STDOUT: inst_block6000003E: +// CHECK:STDOUT: inst_block60000042: // CHECK:STDOUT: 0: inst600000C6 // CHECK:STDOUT: 1: inst600000C7 // CHECK:STDOUT: 2: inst600000C8 -// CHECK:STDOUT: inst_block6000003F: +// CHECK:STDOUT: inst_block60000043: // CHECK:STDOUT: 0: inst6000006C // CHECK:STDOUT: 1: inst600000D4 -// CHECK:STDOUT: inst_block60000040: +// CHECK:STDOUT: inst_block60000044: // CHECK:STDOUT: 0: inst600000D6 -// CHECK:STDOUT: inst_block60000041: +// CHECK:STDOUT: inst_block60000045: // CHECK:STDOUT: 0: inst6000006B // CHECK:STDOUT: 1: inst600000D3 -// CHECK:STDOUT: inst_block60000042: +// CHECK:STDOUT: inst_block60000046: // CHECK:STDOUT: 0: inst6000004F // CHECK:STDOUT: 1: inst6000004F -// CHECK:STDOUT: inst_block60000043: +// CHECK:STDOUT: inst_block60000047: // CHECK:STDOUT: 0: inst6000006B // CHECK:STDOUT: 1: inst600000D3 // CHECK:STDOUT: 2: inst600000DD @@ -1767,20 +1779,23 @@ fn Foo[T:! type](p: T*) -> (T*, ()) { // CHECK:STDOUT: 4: inst600000D4 // CHECK:STDOUT: 5: inst600000D5 // CHECK:STDOUT: 6: inst600000D8 -// CHECK:STDOUT: inst_block60000044: +// CHECK:STDOUT: inst_block60000048: // CHECK:STDOUT: 0: inst600000DA // CHECK:STDOUT: 1: inst600000DB -// CHECK:STDOUT: inst_block60000045: +// CHECK:STDOUT: inst_block60000049: // CHECK:STDOUT: 0: inst600000E2 -// CHECK:STDOUT: inst_block60000046: +// CHECK:STDOUT: 1: inst600000E0 +// CHECK:STDOUT: inst_block6000004A: +// CHECK:STDOUT: 0: inst600000E2 +// CHECK:STDOUT: inst_block6000004B: // CHECK:STDOUT: 0: inst600000E0 -// CHECK:STDOUT: inst_block60000047: +// CHECK:STDOUT: inst_block6000004C: // CHECK:STDOUT: 0: inst600000E6 // CHECK:STDOUT: 1: inst600000E7 -// CHECK:STDOUT: inst_block60000048: +// CHECK:STDOUT: inst_block6000004D: // CHECK:STDOUT: 0: inst600000E9 // CHECK:STDOUT: 1: inst600000EB -// CHECK:STDOUT: inst_block60000049: +// CHECK:STDOUT: inst_block6000004E: // CHECK:STDOUT: 0: inst600000E8 // CHECK:STDOUT: 1: inst600000E9 // CHECK:STDOUT: 2: inst600000EA @@ -1788,18 +1803,18 @@ fn Foo[T:! type](p: T*) -> (T*, ()) { // CHECK:STDOUT: 4: inst600000EC // CHECK:STDOUT: 5: inst600000ED // CHECK:STDOUT: 6: inst600000EE -// CHECK:STDOUT: inst_block6000004A: +// CHECK:STDOUT: inst_block6000004F: // CHECK:STDOUT: 0: inst600000D3 -// CHECK:STDOUT: inst_block6000004B: +// CHECK:STDOUT: inst_block60000050: // CHECK:STDOUT: 0: inst600000D3 // CHECK:STDOUT: 1: inst600000D4 // CHECK:STDOUT: 2: inst600000F4 // CHECK:STDOUT: 3: inst600000F3 -// CHECK:STDOUT: inst_block6000004C: +// CHECK:STDOUT: inst_block60000051: // CHECK:STDOUT: 0: inst600000E8 -// CHECK:STDOUT: inst_block6000004D: +// CHECK:STDOUT: inst_block60000052: // CHECK:STDOUT: 0: inst600000EA -// CHECK:STDOUT: inst_block6000004E: +// CHECK:STDOUT: inst_block60000053: // CHECK:STDOUT: 0: inst600000F7 // CHECK:STDOUT: 1: inst600000F8 // CHECK:STDOUT: 2: inst600000F9 @@ -1811,7 +1826,7 @@ fn Foo[T:! type](p: T*) -> (T*, ()) { // CHECK:STDOUT: 8: inst600000FF // CHECK:STDOUT: 9: inst60000100 // CHECK:STDOUT: 10: inst60000101 -// CHECK:STDOUT: inst_block6000004F: +// CHECK:STDOUT: inst_block60000054: // CHECK:STDOUT: 0: inst6000006B // CHECK:STDOUT: 1: inst6000006C // CHECK:STDOUT: 2: inst600000D3 @@ -1819,22 +1834,22 @@ fn Foo[T:! type](p: T*) -> (T*, ()) { // CHECK:STDOUT: 4: inst600000D5 // CHECK:STDOUT: 5: inst600000DE // CHECK:STDOUT: 6: inst600000E3 -// CHECK:STDOUT: inst_block60000050: +// CHECK:STDOUT: inst_block60000055: // CHECK:STDOUT: 0: inst60000103 // CHECK:STDOUT: 1: inst60000102 -// CHECK:STDOUT: inst_block60000051: +// CHECK:STDOUT: inst_block60000056: // CHECK:STDOUT: 0: inst60000106 // CHECK:STDOUT: 1: inst60000107 -// CHECK:STDOUT: inst_block60000052: +// CHECK:STDOUT: inst_block60000057: // CHECK:STDOUT: 0: inst60000108 // CHECK:STDOUT: 1: inst60000109 -// CHECK:STDOUT: inst_block60000053: +// CHECK:STDOUT: inst_block60000058: // CHECK:STDOUT: 0: inst6000010B // CHECK:STDOUT: 1: inst6000010C -// CHECK:STDOUT: inst_block60000054: +// CHECK:STDOUT: inst_block60000059: // CHECK:STDOUT: 0: inst60000108 // CHECK:STDOUT: 1: inst60000109 -// CHECK:STDOUT: inst_block60000055: +// CHECK:STDOUT: inst_block6000005A: // CHECK:STDOUT: 0: inst60000108 // CHECK:STDOUT: 1: inst60000109 // CHECK:STDOUT: 2: inst6000010A @@ -1842,27 +1857,27 @@ fn Foo[T:! type](p: T*) -> (T*, ()) { // CHECK:STDOUT: 4: inst6000010C // CHECK:STDOUT: 5: inst6000010D // CHECK:STDOUT: 6: inst6000010E -// CHECK:STDOUT: inst_block60000056: +// CHECK:STDOUT: inst_block6000005B: // CHECK:STDOUT: 0: inst60000108 // CHECK:STDOUT: 1: inst60000109 -// CHECK:STDOUT: inst_block60000057: +// CHECK:STDOUT: inst_block6000005C: // CHECK:STDOUT: 0: inst6000010F // CHECK:STDOUT: 1: inst60000110 -// CHECK:STDOUT: inst_block60000058: +// CHECK:STDOUT: inst_block6000005D: // CHECK:STDOUT: 0: inst6000006C // CHECK:STDOUT: 1: inst600000D4 // CHECK:STDOUT: 2: inst60000114 -// CHECK:STDOUT: inst_block60000059: +// CHECK:STDOUT: inst_block6000005E: // CHECK:STDOUT: 0: inst60000116 -// CHECK:STDOUT: inst_block6000005A: +// CHECK:STDOUT: inst_block6000005F: // CHECK:STDOUT: 0: inst6000006B // CHECK:STDOUT: 1: inst600000D3 // CHECK:STDOUT: 2: inst60000113 -// CHECK:STDOUT: inst_block6000005B: +// CHECK:STDOUT: inst_block60000060: // CHECK:STDOUT: 0: inst6000004F // CHECK:STDOUT: 1: inst6000004F // CHECK:STDOUT: 2: inst6000004F -// CHECK:STDOUT: inst_block6000005C: +// CHECK:STDOUT: inst_block60000061: // CHECK:STDOUT: 0: inst6000006B // CHECK:STDOUT: 1: inst600000D3 // CHECK:STDOUT: 2: inst60000113 @@ -1872,22 +1887,25 @@ fn Foo[T:! type](p: T*) -> (T*, ()) { // CHECK:STDOUT: 6: inst60000114 // CHECK:STDOUT: 7: inst60000115 // CHECK:STDOUT: 8: inst60000118 -// CHECK:STDOUT: inst_block6000005D: +// CHECK:STDOUT: inst_block60000062: // CHECK:STDOUT: 0: inst6000011A // CHECK:STDOUT: 1: inst6000011B -// CHECK:STDOUT: inst_block6000005E: +// CHECK:STDOUT: inst_block60000063: // CHECK:STDOUT: 0: inst60000122 -// CHECK:STDOUT: inst_block6000005F: +// CHECK:STDOUT: 1: inst60000120 +// CHECK:STDOUT: inst_block60000064: +// CHECK:STDOUT: 0: inst60000122 +// CHECK:STDOUT: inst_block60000065: // CHECK:STDOUT: 0: inst60000120 -// CHECK:STDOUT: inst_block60000060: +// CHECK:STDOUT: inst_block60000066: // CHECK:STDOUT: 0: inst60000126 // CHECK:STDOUT: 1: inst60000127 // CHECK:STDOUT: 2: inst60000128 -// CHECK:STDOUT: inst_block60000061: +// CHECK:STDOUT: inst_block60000067: // CHECK:STDOUT: 0: inst6000012A // CHECK:STDOUT: 1: inst6000012C // CHECK:STDOUT: 2: inst6000012E -// CHECK:STDOUT: inst_block60000062: +// CHECK:STDOUT: inst_block60000068: // CHECK:STDOUT: 0: inst60000129 // CHECK:STDOUT: 1: inst6000012A // CHECK:STDOUT: 2: inst6000012B @@ -1897,20 +1915,20 @@ fn Foo[T:! type](p: T*) -> (T*, ()) { // CHECK:STDOUT: 6: inst6000012F // CHECK:STDOUT: 7: inst60000130 // CHECK:STDOUT: 8: inst60000131 -// CHECK:STDOUT: inst_block60000063: +// CHECK:STDOUT: inst_block60000069: // CHECK:STDOUT: 0: inst60000113 -// CHECK:STDOUT: inst_block60000064: +// CHECK:STDOUT: inst_block6000006A: // CHECK:STDOUT: 0: inst60000113 // CHECK:STDOUT: 1: inst60000114 // CHECK:STDOUT: 2: inst60000137 // CHECK:STDOUT: 3: inst60000136 -// CHECK:STDOUT: inst_block60000065: +// CHECK:STDOUT: inst_block6000006B: // CHECK:STDOUT: 0: inst60000129 -// CHECK:STDOUT: inst_block60000066: +// CHECK:STDOUT: inst_block6000006C: // CHECK:STDOUT: 0: inst6000012B -// CHECK:STDOUT: inst_block60000067: +// CHECK:STDOUT: inst_block6000006D: // CHECK:STDOUT: 0: inst6000012D -// CHECK:STDOUT: inst_block60000068: +// CHECK:STDOUT: inst_block6000006E: // CHECK:STDOUT: 0: inst6000013A // CHECK:STDOUT: 1: inst6000013B // CHECK:STDOUT: 2: inst6000013C @@ -1927,7 +1945,7 @@ fn Foo[T:! type](p: T*) -> (T*, ()) { // CHECK:STDOUT: 13: inst60000147 // CHECK:STDOUT: 14: inst60000148 // CHECK:STDOUT: 15: inst60000149 -// CHECK:STDOUT: inst_block60000069: +// CHECK:STDOUT: inst_block6000006F: // CHECK:STDOUT: 0: inst6000006B // CHECK:STDOUT: 1: inst6000006C // CHECK:STDOUT: 2: inst600000D3 @@ -1937,27 +1955,27 @@ fn Foo[T:! type](p: T*) -> (T*, ()) { // CHECK:STDOUT: 6: inst60000115 // CHECK:STDOUT: 7: inst6000011E // CHECK:STDOUT: 8: inst60000123 -// CHECK:STDOUT: inst_block6000006A: +// CHECK:STDOUT: inst_block60000070: // CHECK:STDOUT: 0: inst6000014C // CHECK:STDOUT: 1: inst6000014B // CHECK:STDOUT: 2: inst6000014A -// CHECK:STDOUT: inst_block6000006B: +// CHECK:STDOUT: inst_block60000071: // CHECK:STDOUT: 0: inst6000014F // CHECK:STDOUT: 1: inst60000150 // CHECK:STDOUT: 2: inst60000151 -// CHECK:STDOUT: inst_block6000006C: +// CHECK:STDOUT: inst_block60000072: // CHECK:STDOUT: 0: inst60000152 // CHECK:STDOUT: 1: inst60000153 // CHECK:STDOUT: 2: inst60000154 -// CHECK:STDOUT: inst_block6000006D: +// CHECK:STDOUT: inst_block60000073: // CHECK:STDOUT: 0: inst60000156 // CHECK:STDOUT: 1: inst60000157 // CHECK:STDOUT: 2: inst60000158 -// CHECK:STDOUT: inst_block6000006E: +// CHECK:STDOUT: inst_block60000074: // CHECK:STDOUT: 0: inst60000152 // CHECK:STDOUT: 1: inst60000153 // CHECK:STDOUT: 2: inst60000154 -// CHECK:STDOUT: inst_block6000006F: +// CHECK:STDOUT: inst_block60000075: // CHECK:STDOUT: 0: inst60000152 // CHECK:STDOUT: 1: inst60000153 // CHECK:STDOUT: 2: inst60000154 @@ -1967,38 +1985,38 @@ fn Foo[T:! type](p: T*) -> (T*, ()) { // CHECK:STDOUT: 6: inst60000158 // CHECK:STDOUT: 7: inst60000159 // CHECK:STDOUT: 8: inst6000015A -// CHECK:STDOUT: inst_block60000070: +// CHECK:STDOUT: inst_block60000076: // CHECK:STDOUT: 0: inst60000152 // CHECK:STDOUT: 1: inst60000153 // CHECK:STDOUT: 2: inst60000154 -// CHECK:STDOUT: inst_block60000071: +// CHECK:STDOUT: inst_block60000077: // CHECK:STDOUT: 0: inst6000015B // CHECK:STDOUT: 1: inst6000015C -// CHECK:STDOUT: inst_block60000072: +// CHECK:STDOUT: inst_block60000078: // CHECK:STDOUT: 0: inst600000B8 // CHECK:STDOUT: 1: inst600000B9 // CHECK:STDOUT: 2: inst60000044 -// CHECK:STDOUT: inst_block60000073: +// CHECK:STDOUT: inst_block60000079: // CHECK:STDOUT: 0: inst60000017 -// CHECK:STDOUT: inst_block60000074: +// CHECK:STDOUT: inst_block6000007A: // CHECK:STDOUT: 0: inst60000160 -// CHECK:STDOUT: inst_block60000075: +// CHECK:STDOUT: inst_block6000007B: // CHECK:STDOUT: 0: inst60000161 -// CHECK:STDOUT: inst_block60000076: +// CHECK:STDOUT: inst_block6000007C: // CHECK:STDOUT: 0: inst60000162 -// CHECK:STDOUT: inst_block60000077: +// CHECK:STDOUT: inst_block6000007D: // CHECK:STDOUT: 0: inst60000162 // CHECK:STDOUT: 1: inst6000001C // CHECK:STDOUT: 2: inst6000001F // CHECK:STDOUT: 3: inst600000BE -// CHECK:STDOUT: inst_block60000078: +// CHECK:STDOUT: inst_block6000007E: // CHECK:STDOUT: 0: inst60000166 -// CHECK:STDOUT: inst_block60000079: +// CHECK:STDOUT: inst_block6000007F: // CHECK:STDOUT: 0: inst60000047 -// CHECK:STDOUT: inst_block6000007A: +// CHECK:STDOUT: inst_block60000080: // CHECK:STDOUT: 0: inst60000170 // CHECK:STDOUT: 1: inst60000173 -// CHECK:STDOUT: inst_block6000007B: +// CHECK:STDOUT: inst_block60000081: // CHECK:STDOUT: 0: inst60000042 // CHECK:STDOUT: 1: inst60000045 // CHECK:STDOUT: 2: inst6000015F @@ -2007,7 +2025,7 @@ fn Foo[T:! type](p: T*) -> (T*, ()) { // CHECK:STDOUT: 5: inst60000167 // CHECK:STDOUT: 6: inst60000168 // CHECK:STDOUT: 7: inst6000016C -// CHECK:STDOUT: inst_block6000007C: +// CHECK:STDOUT: inst_block60000082: // CHECK:STDOUT: 0: instF // CHECK:STDOUT: 1: inst60000010 // CHECK:STDOUT: 2: inst6000003C diff --git a/toolchain/check/testdata/basics/raw_sem_ir/one_file_with_textual_ir.carbon b/toolchain/check/testdata/basics/raw_sem_ir/one_file_with_textual_ir.carbon index 708f578fd8b8..32a717269a48 100644 --- a/toolchain/check/testdata/basics/raw_sem_ir/one_file_with_textual_ir.carbon +++ b/toolchain/check/testdata/basics/raw_sem_ir/one_file_with_textual_ir.carbon @@ -31,7 +31,7 @@ fn Foo(n: ()) -> ((), ()) { // CHECK:STDOUT: entity_name60000000: {name: name1, parent_scope: name_scope, index: -1, is_template: 0} // CHECK:STDOUT: cpp_global_vars: {} // CHECK:STDOUT: functions: -// CHECK:STDOUT: function60000000: {name: name0, parent_scope: name_scope0, call_params_id: inst_block6000000B, return_type_inst_id: inst60000020, return_form_inst_id: inst60000021, return_patterns_id: inst_block6000000A, body: [inst_block6000000E]} +// CHECK:STDOUT: function60000000: {name: name0, parent_scope: name_scope0, call_param_patterns_id: inst_block6000000B, call_params_id: inst_block6000000C, return_type_inst_id: inst60000020, return_form_inst_id: inst60000021, return_patterns_id: inst_block6000000A, body: [inst_block6000000F]} // CHECK:STDOUT: classes: {} // CHECK:STDOUT: generics: {} // CHECK:STDOUT: specifics: {} @@ -82,19 +82,19 @@ fn Foo(n: ()) -> ((), ()) { // CHECK:STDOUT: inst60000027: {kind: SpliceBlock, arg0: inst_block60000004, arg1: inst60000013, type: type(TypeType)} // CHECK:STDOUT: inst60000028: {kind: OutParam, arg0: call_param1, arg1: name(ReturnSlot), type: type(inst6000001A)} // CHECK:STDOUT: inst60000029: {kind: ReturnSlot, arg0: inst6000001A, arg1: inst60000028, type: type(inst6000001A)} -// CHECK:STDOUT: inst6000002A: {kind: FunctionDecl, arg0: function60000000, arg1: inst_block6000000D, type: type(inst6000002B)} +// CHECK:STDOUT: inst6000002A: {kind: FunctionDecl, arg0: function60000000, arg1: inst_block6000000E, type: type(inst6000002B)} // CHECK:STDOUT: inst6000002B: {kind: FunctionType, arg0: function60000000, arg1: specific, type: type(TypeType)} // CHECK:STDOUT: inst6000002C: {kind: StructValue, arg0: inst_block_empty, type: type(inst6000002B)} // CHECK:STDOUT: inst6000002D: {kind: NameRef, arg0: name1, arg1: inst60000014, type: type(inst60000010)} // CHECK:STDOUT: inst6000002E: {kind: TupleLiteral, arg0: inst_block_empty, type: type(inst60000010)} -// CHECK:STDOUT: inst6000002F: {kind: TupleLiteral, arg0: inst_block6000000F, type: type(inst6000001A)} +// CHECK:STDOUT: inst6000002F: {kind: TupleLiteral, arg0: inst_block60000010, type: type(inst6000001A)} // CHECK:STDOUT: inst60000030: {kind: TupleAccess, arg0: inst60000028, arg1: element0, type: type(inst60000010)} -// CHECK:STDOUT: inst60000031: {kind: TupleInit, arg0: inst_block60000010, arg1: inst60000030, type: type(inst60000010)} +// CHECK:STDOUT: inst60000031: {kind: TupleInit, arg0: inst_block60000011, arg1: inst60000030, type: type(inst60000010)} // CHECK:STDOUT: inst60000032: {kind: Converted, arg0: inst6000002D, arg1: inst60000031, type: type(inst60000010)} // CHECK:STDOUT: inst60000033: {kind: TupleAccess, arg0: inst60000028, arg1: element1, type: type(inst60000010)} // CHECK:STDOUT: inst60000034: {kind: TupleInit, arg0: inst_block_empty, arg1: inst60000033, type: type(inst60000010)} // CHECK:STDOUT: inst60000035: {kind: Converted, arg0: inst6000002E, arg1: inst60000034, type: type(inst60000010)} -// CHECK:STDOUT: inst60000036: {kind: TupleInit, arg0: inst_block60000011, arg1: inst60000028, type: type(inst6000001A)} +// CHECK:STDOUT: inst60000036: {kind: TupleInit, arg0: inst_block60000012, arg1: inst60000028, type: type(inst6000001A)} // CHECK:STDOUT: inst60000037: {kind: Converted, arg0: inst6000002F, arg1: inst60000036, type: type(inst6000001A)} // CHECK:STDOUT: inst60000038: {kind: ReturnExpr, arg0: inst60000037, arg1: inst60000028} // CHECK:STDOUT: constant_values: @@ -159,14 +159,17 @@ fn Foo(n: ()) -> ((), ()) { // CHECK:STDOUT: inst_block6000000A: // CHECK:STDOUT: 0: inst60000025 // CHECK:STDOUT: inst_block6000000B: +// CHECK:STDOUT: 0: inst60000017 +// CHECK:STDOUT: 1: inst60000025 +// CHECK:STDOUT: inst_block6000000C: // CHECK:STDOUT: 0: inst60000026 // CHECK:STDOUT: 1: inst60000028 -// CHECK:STDOUT: inst_block6000000C: +// CHECK:STDOUT: inst_block6000000D: // CHECK:STDOUT: 0: inst60000016 // CHECK:STDOUT: 1: inst60000017 // CHECK:STDOUT: 2: inst60000024 // CHECK:STDOUT: 3: inst60000025 -// CHECK:STDOUT: inst_block6000000D: +// CHECK:STDOUT: inst_block6000000E: // CHECK:STDOUT: 0: inst60000018 // CHECK:STDOUT: 1: inst60000019 // CHECK:STDOUT: 2: inst6000001B @@ -179,7 +182,7 @@ fn Foo(n: ()) -> ((), ()) { // CHECK:STDOUT: 9: inst60000014 // CHECK:STDOUT: 10: inst60000028 // CHECK:STDOUT: 11: inst60000029 -// CHECK:STDOUT: inst_block6000000E: +// CHECK:STDOUT: inst_block6000000F: // CHECK:STDOUT: 0: inst6000002D // CHECK:STDOUT: 1: inst6000002E // CHECK:STDOUT: 2: inst6000002F @@ -192,14 +195,14 @@ fn Foo(n: ()) -> ((), ()) { // CHECK:STDOUT: 9: inst60000036 // CHECK:STDOUT: 10: inst60000037 // CHECK:STDOUT: 11: inst60000038 -// CHECK:STDOUT: inst_block6000000F: +// CHECK:STDOUT: inst_block60000010: // CHECK:STDOUT: 0: inst6000002D // CHECK:STDOUT: 1: inst6000002E -// CHECK:STDOUT: inst_block60000010: {} -// CHECK:STDOUT: inst_block60000011: +// CHECK:STDOUT: inst_block60000011: {} +// CHECK:STDOUT: inst_block60000012: // CHECK:STDOUT: 0: inst60000032 // CHECK:STDOUT: 1: inst60000035 -// CHECK:STDOUT: inst_block60000012: +// CHECK:STDOUT: inst_block60000013: // CHECK:STDOUT: 0: instF // CHECK:STDOUT: 1: inst6000002A // CHECK:STDOUT: ... diff --git a/toolchain/check/thunk.cpp b/toolchain/check/thunk.cpp index 70bd0ceae97a..8490c3f4c71c 100644 --- a/toolchain/check/thunk.cpp +++ b/toolchain/check/thunk.cpp @@ -194,7 +194,7 @@ static auto CloneFunctionDecl(Context& context, SemIR::LocId loc_id, // Perform callee-side pattern matching to rebuild the parameter list. context.inst_block_stack().Push(); - auto call_params_id = + auto [call_param_patterns_id, call_params_id] = CalleePatternMatch(context, implicit_param_patterns_id, param_patterns_id, return_patterns_id); auto decl_block_id = context.inst_block_stack().Pop(); @@ -222,7 +222,8 @@ static auto CloneFunctionDecl(Context& context, SemIR::LocId loc_id, .non_owning_decl_id = SemIR::InstId::None, .first_owning_decl_id = decl_id, .definition_id = decl_id}, - {.call_params_id = call_params_id, + {.call_param_patterns_id = call_param_patterns_id, + .call_params_id = call_params_id, .return_type_inst_id = return_type_inst_id, .return_form_inst_id = return_form_inst_id, .return_patterns_id = return_patterns_id, diff --git a/toolchain/sem_ir/function.h b/toolchain/sem_ir/function.h index cb6738a7e628..d4b552f9875b 100644 --- a/toolchain/sem_ir/function.h +++ b/toolchain/sem_ir/function.h @@ -31,17 +31,20 @@ struct FunctionFields { // The following members always have values, and do not change throughout the // lifetime of the function. - // This block consists of references to the `AnyParam` insts that represent - // the function's `Call` parameters. The "`Call` parameters" are the - // parameters corresponding to the arguments that are passed to a `Call` - // inst, so they do not include compile-time parameters, but they do include - // the return slot. + // This block consists of references to the `*ParamPattern` insts that + // represent the function's `Call` parameters. The "`Call` parameters" are the + // parameters corresponding to the arguments that are passed to a `Call` inst, + // so they do not include compile-time parameters, but they do include the + // return slot. // // The parameters appear in declaration order: `self` (if present), then the // explicit runtime parameters, then the return parameters (which are - // "declared" by the function's return type declaration). This is not - // populated on imported functions, because it is relevant only for a function - // definition. + // "declared" by the function's return type declaration). + InstBlockId call_param_patterns_id; + + // This block consists of references to the `AnyParam` insts that correspond + // to call_param_patterns_id. This is not populated on imported functions, + // because it is relevant only for a function definition. InstBlockId call_params_id; // The inst representing the type component of return_form_inst_id. @@ -61,8 +64,6 @@ struct FunctionFields { // Note: As of this writing we don't support non-initializing return forms, // so this will always be have exactly 1 element if the function has an // explicitly declared return type. - // - // TODO: replace this with a block of all call parameter patterns. InstBlockId return_patterns_id; // Which kind of special function this is, if any. This is used in cases where @@ -114,6 +115,9 @@ struct Function : public EntityWithParamsBase, auto Print(llvm::raw_ostream& out) const -> void { out << "{"; PrintBaseFields(out); + if (call_param_patterns_id.has_value()) { + out << ", call_param_patterns_id: " << call_param_patterns_id; + } if (call_params_id.has_value()) { out << ", call_params_id: " << call_params_id; }