Remove index fields from ParamPatterns (#6815)

This is a step toward removing the index from `InitForm`, so that equal
form values always have equal representations.

---------

Co-authored-by: Jon Ross-Perkins <jperkins@google.com>
This commit is contained in:
Geoff Romer
2026-03-03 00:19:47 +00:00
committed by GitHub
co-authored by Jon Ross-Perkins
parent 9ff6b0a682
commit 6dba8ee111
298 changed files with 1741 additions and 1747 deletions
+19 -19
View File
@@ -157,9 +157,9 @@ fn InstanceC(a: A) -> C {
// CHECK:STDOUT: !with Self:
// CHECK:STDOUT: %ImplicitAs.WithSelf.Convert.decl: @ImplicitAs.WithSelf.%ImplicitAs.WithSelf.Convert.type (%ImplicitAs.WithSelf.Convert.type) = fn_decl @ImplicitAs.WithSelf.Convert [symbolic = @ImplicitAs.WithSelf.%ImplicitAs.WithSelf.Convert (constants.%ImplicitAs.WithSelf.Convert)] {
// CHECK:STDOUT: %self.patt: @ImplicitAs.WithSelf.Convert.%pattern_type.loc4_14 (%pattern_type.8de) = value_binding_pattern self [concrete]
// CHECK:STDOUT: %self.param_patt: @ImplicitAs.WithSelf.Convert.%pattern_type.loc4_14 (%pattern_type.8de) = value_param_pattern %self.patt, call_param0 [concrete]
// CHECK:STDOUT: %self.param_patt: @ImplicitAs.WithSelf.Convert.%pattern_type.loc4_14 (%pattern_type.8de) = value_param_pattern %self.patt [concrete]
// CHECK:STDOUT: %return.patt: @ImplicitAs.WithSelf.Convert.%pattern_type.loc4_28 (%pattern_type.51d) = return_slot_pattern [concrete]
// CHECK:STDOUT: %return.param_patt: @ImplicitAs.WithSelf.Convert.%pattern_type.loc4_28 (%pattern_type.51d) = out_param_pattern %return.patt, call_param1 [concrete]
// CHECK:STDOUT: %return.param_patt: @ImplicitAs.WithSelf.Convert.%pattern_type.loc4_28 (%pattern_type.51d) = out_param_pattern %return.patt [concrete]
// CHECK:STDOUT: } {
// CHECK:STDOUT: %Dest.ref: type = name_ref Dest, @ImplicitAs.%Dest.loc3_22.2 [symbolic = %Dest (constants.%Dest)]
// CHECK:STDOUT: %.loc4_31.2: Core.Form = init_form %Dest.ref, call_param1 [symbolic = %.loc4_31.1 (constants.%.3cf)]
@@ -293,7 +293,7 @@ fn InstanceC(a: A) -> C {
// CHECK:STDOUT: }
// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {
// CHECK:STDOUT: %a.patt: %pattern_type.1ab = value_binding_pattern a [concrete]
// CHECK:STDOUT: %a.param_patt: %pattern_type.1ab = value_param_pattern %a.patt, call_param0 [concrete]
// CHECK:STDOUT: %a.param_patt: %pattern_type.1ab = value_param_pattern %a.patt [concrete]
// CHECK:STDOUT: } {
// CHECK:STDOUT: %a.param: %A = value_param call_param0
// CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [concrete = constants.%A]
@@ -315,7 +315,7 @@ fn InstanceC(a: A) -> C {
// CHECK:STDOUT: !with Self:
// CHECK:STDOUT: %Action.WithSelf.Op.decl: @Action.WithSelf.%Action.WithSelf.Op.type (%Action.WithSelf.Op.type.ecb) = fn_decl @Action.WithSelf.Op [symbolic = @Action.WithSelf.%Action.WithSelf.Op (constants.%Action.WithSelf.Op.a8d)] {
// CHECK:STDOUT: %self.patt: @Action.WithSelf.Op.%pattern_type (%pattern_type.84c) = value_binding_pattern self [concrete]
// CHECK:STDOUT: %self.param_patt: @Action.WithSelf.Op.%pattern_type (%pattern_type.84c) = value_param_pattern %self.patt, call_param0 [concrete]
// CHECK:STDOUT: %self.param_patt: @Action.WithSelf.Op.%pattern_type (%pattern_type.84c) = value_param_pattern %self.patt [concrete]
// CHECK:STDOUT: } {
// CHECK:STDOUT: %self.param: @Action.WithSelf.Op.%Self.binding.as_type (%Self.binding.as_type) = value_param call_param0
// CHECK:STDOUT: %.loc5_15.1: type = splice_block %.loc5_15.3 [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type)] {
@@ -340,7 +340,7 @@ fn InstanceC(a: A) -> C {
// CHECK:STDOUT: impl @A.as.Action.impl: %A.ref as %Action.type {
// CHECK:STDOUT: %A.as.Action.impl.Op.decl: %A.as.Action.impl.Op.type = fn_decl @A.as.Action.impl.Op [concrete = constants.%A.as.Action.impl.Op] {
// CHECK:STDOUT: %self.patt: %pattern_type.1ab = value_binding_pattern self [concrete]
// CHECK:STDOUT: %self.param_patt: %pattern_type.1ab = value_param_pattern %self.patt, call_param0 [concrete]
// CHECK:STDOUT: %self.param_patt: %pattern_type.1ab = value_param_pattern %self.patt [concrete]
// CHECK:STDOUT: } {
// CHECK:STDOUT: %self.param: %A = value_param call_param0
// CHECK:STDOUT: %Self.ref: type = name_ref Self, @A.as.Action.impl.%A.ref [concrete = constants.%A]
@@ -541,7 +541,7 @@ fn InstanceC(a: A) -> C {
// CHECK:STDOUT: %Core.import = import Core
// CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [concrete = constants.%G] {
// CHECK:STDOUT: %a.patt: %pattern_type.1ab = value_binding_pattern a [concrete]
// CHECK:STDOUT: %a.param_patt: %pattern_type.1ab = value_param_pattern %a.patt, call_param0 [concrete]
// CHECK:STDOUT: %a.param_patt: %pattern_type.1ab = value_param_pattern %a.patt [concrete]
// CHECK:STDOUT: } {
// CHECK:STDOUT: %a.param: %A = value_param call_param0
// CHECK:STDOUT: %A.ref: type = name_ref A, imports.%Main.A [concrete = constants.%A]
@@ -733,7 +733,7 @@ fn InstanceC(a: A) -> C {
// CHECK:STDOUT: %Core.import = import Core
// CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [concrete = constants.%G] {
// CHECK:STDOUT: %a.patt: %pattern_type.1ab = value_binding_pattern a [concrete]
// CHECK:STDOUT: %a.param_patt: %pattern_type.1ab = value_param_pattern %a.patt, call_param0 [concrete]
// CHECK:STDOUT: %a.param_patt: %pattern_type.1ab = value_param_pattern %a.patt [concrete]
// CHECK:STDOUT: } {
// CHECK:STDOUT: %a.param: %A = value_param call_param0
// CHECK:STDOUT: %A.ref: type = name_ref A, imports.%Main.A [concrete = constants.%A]
@@ -947,7 +947,7 @@ fn InstanceC(a: A) -> C {
// CHECK:STDOUT: !with Self:
// CHECK:STDOUT: %Factory.WithSelf.Make.decl: @Factory.WithSelf.%Factory.WithSelf.Make.type (%Factory.WithSelf.Make.type.086) = fn_decl @Factory.WithSelf.Make [symbolic = @Factory.WithSelf.%Factory.WithSelf.Make (constants.%Factory.WithSelf.Make.6b9)] {
// CHECK:STDOUT: %return.patt: @Factory.WithSelf.Make.%pattern_type (%pattern_type.51d) = return_slot_pattern [concrete]
// CHECK:STDOUT: %return.param_patt: @Factory.WithSelf.Make.%pattern_type (%pattern_type.51d) = out_param_pattern %return.patt, call_param0 [concrete]
// CHECK:STDOUT: %return.param_patt: @Factory.WithSelf.Make.%pattern_type (%pattern_type.51d) = out_param_pattern %return.patt [concrete]
// CHECK:STDOUT: } {
// CHECK:STDOUT: %T.ref: type = name_ref T, @Factory.%T.loc4_19.2 [symbolic = %T (constants.%T)]
// CHECK:STDOUT: %.loc6_16.2: Core.Form = init_form %T.ref, call_param0 [symbolic = %.loc6_16.1 (constants.%.41b)]
@@ -957,9 +957,9 @@ fn InstanceC(a: A) -> C {
// CHECK:STDOUT: %assoc0.loc6_17.1: @Factory.WithSelf.%Factory.assoc_type (%Factory.assoc_type.129) = assoc_entity element0, %Factory.WithSelf.Make.decl [symbolic = %assoc0.loc6_17.2 (constants.%assoc0.cdd)]
// CHECK:STDOUT: %Factory.WithSelf.Method.decl: @Factory.WithSelf.%Factory.WithSelf.Method.type (%Factory.WithSelf.Method.type.900) = fn_decl @Factory.WithSelf.Method [symbolic = @Factory.WithSelf.%Factory.WithSelf.Method (constants.%Factory.WithSelf.Method.655)] {
// CHECK:STDOUT: %self.patt: @Factory.WithSelf.Method.%pattern_type.loc8_13 (%pattern_type.077) = value_binding_pattern self [concrete]
// CHECK:STDOUT: %self.param_patt: @Factory.WithSelf.Method.%pattern_type.loc8_13 (%pattern_type.077) = value_param_pattern %self.patt, call_param0 [concrete]
// CHECK:STDOUT: %self.param_patt: @Factory.WithSelf.Method.%pattern_type.loc8_13 (%pattern_type.077) = value_param_pattern %self.patt [concrete]
// CHECK:STDOUT: %return.patt: @Factory.WithSelf.Method.%pattern_type.loc8_27 (%pattern_type.51d) = return_slot_pattern [concrete]
// CHECK:STDOUT: %return.param_patt: @Factory.WithSelf.Method.%pattern_type.loc8_27 (%pattern_type.51d) = out_param_pattern %return.patt, call_param1 [concrete]
// CHECK:STDOUT: %return.param_patt: @Factory.WithSelf.Method.%pattern_type.loc8_27 (%pattern_type.51d) = out_param_pattern %return.patt [concrete]
// CHECK:STDOUT: } {
// CHECK:STDOUT: %T.ref: type = name_ref T, @Factory.%T.loc4_19.2 [symbolic = %T (constants.%T)]
// CHECK:STDOUT: %.loc8_30.2: Core.Form = init_form %T.ref, call_param1 [symbolic = %.loc8_30.1 (constants.%.3cf)]
@@ -991,7 +991,7 @@ fn InstanceC(a: A) -> C {
// CHECK:STDOUT: impl @A.as.Factory.impl: %A.ref as %Factory.type {
// CHECK:STDOUT: %A.as.Factory.impl.Make.decl: %A.as.Factory.impl.Make.type = fn_decl @A.as.Factory.impl.Make [concrete = constants.%A.as.Factory.impl.Make] {
// CHECK:STDOUT: %return.patt: %pattern_type.1f4 = return_slot_pattern [concrete]
// CHECK:STDOUT: %return.param_patt: %pattern_type.1f4 = out_param_pattern %return.patt, call_param0 [concrete]
// CHECK:STDOUT: %return.param_patt: %pattern_type.1f4 = out_param_pattern %return.patt [concrete]
// CHECK:STDOUT: } {
// CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl [concrete = constants.%B]
// CHECK:STDOUT: %.loc15: Core.Form = init_form %B.ref, call_param0 [concrete = constants.%.e82]
@@ -1000,9 +1000,9 @@ fn InstanceC(a: A) -> C {
// CHECK:STDOUT: }
// CHECK:STDOUT: %A.as.Factory.impl.Method.decl: %A.as.Factory.impl.Method.type = fn_decl @A.as.Factory.impl.Method [concrete = constants.%A.as.Factory.impl.Method] {
// CHECK:STDOUT: %self.patt: %pattern_type.1ab = value_binding_pattern self [concrete]
// CHECK:STDOUT: %self.param_patt: %pattern_type.1ab = value_param_pattern %self.patt, call_param0 [concrete]
// CHECK:STDOUT: %self.param_patt: %pattern_type.1ab = value_param_pattern %self.patt [concrete]
// CHECK:STDOUT: %return.patt: %pattern_type.1f4 = return_slot_pattern [concrete]
// CHECK:STDOUT: %return.param_patt: %pattern_type.1f4 = out_param_pattern %return.patt, call_param1 [concrete]
// CHECK:STDOUT: %return.param_patt: %pattern_type.1f4 = out_param_pattern %return.patt [concrete]
// CHECK:STDOUT: } {
// CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl [concrete = constants.%B]
// CHECK:STDOUT: %.loc16: Core.Form = init_form %B.ref, call_param1 [concrete = constants.%.916]
@@ -1241,7 +1241,7 @@ fn InstanceC(a: A) -> C {
// CHECK:STDOUT: %Core.import = import Core
// CHECK:STDOUT: %MakeB.decl: %MakeB.type = fn_decl @MakeB [concrete = constants.%MakeB] {
// CHECK:STDOUT: %return.patt: %pattern_type.1f4 = return_slot_pattern [concrete]
// CHECK:STDOUT: %return.param_patt: %pattern_type.1f4 = out_param_pattern %return.patt, call_param0 [concrete]
// CHECK:STDOUT: %return.param_patt: %pattern_type.1f4 = out_param_pattern %return.patt [concrete]
// CHECK:STDOUT: } {
// CHECK:STDOUT: %B.ref.loc4: type = name_ref B, imports.%Main.B [concrete = constants.%B]
// CHECK:STDOUT: %.loc4_15.2: Core.Form = init_form %B.ref.loc4, call_param0 [concrete = constants.%.e82]
@@ -1250,9 +1250,9 @@ fn InstanceC(a: A) -> C {
// CHECK:STDOUT: }
// CHECK:STDOUT: %InstanceB.decl: %InstanceB.type = fn_decl @InstanceB [concrete = constants.%InstanceB] {
// CHECK:STDOUT: %a.patt: %pattern_type.1ab = value_binding_pattern a [concrete]
// CHECK:STDOUT: %a.param_patt: %pattern_type.1ab = value_param_pattern %a.patt, call_param0 [concrete]
// CHECK:STDOUT: %a.param_patt: %pattern_type.1ab = value_param_pattern %a.patt [concrete]
// CHECK:STDOUT: %return.patt: %pattern_type.1f4 = return_slot_pattern [concrete]
// CHECK:STDOUT: %return.param_patt: %pattern_type.1f4 = out_param_pattern %return.patt, call_param1 [concrete]
// CHECK:STDOUT: %return.param_patt: %pattern_type.1f4 = out_param_pattern %return.patt [concrete]
// CHECK:STDOUT: } {
// CHECK:STDOUT: %B.ref.loc7: type = name_ref B, imports.%Main.B [concrete = constants.%B]
// CHECK:STDOUT: %.loc7_23.2: Core.Form = init_form %B.ref.loc7, call_param1 [concrete = constants.%.916]
@@ -1512,7 +1512,7 @@ fn InstanceC(a: A) -> C {
// CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
// CHECK:STDOUT: %MakeC.decl: %MakeC.type = fn_decl @MakeC [concrete = constants.%MakeC] {
// CHECK:STDOUT: %return.patt: %pattern_type.7c7 = return_slot_pattern [concrete]
// CHECK:STDOUT: %return.param_patt: %pattern_type.7c7 = out_param_pattern %return.patt, call_param0 [concrete]
// CHECK:STDOUT: %return.param_patt: %pattern_type.7c7 = out_param_pattern %return.patt [concrete]
// CHECK:STDOUT: } {
// CHECK:STDOUT: %C.ref.loc8: type = name_ref C, file.%C.decl [concrete = constants.%C]
// CHECK:STDOUT: %.loc8: Core.Form = init_form %C.ref.loc8, call_param0 [concrete = constants.%.768]
@@ -1521,9 +1521,9 @@ fn InstanceC(a: A) -> C {
// CHECK:STDOUT: }
// CHECK:STDOUT: %InstanceC.decl: %InstanceC.type = fn_decl @InstanceC [concrete = constants.%InstanceC] {
// CHECK:STDOUT: %a.patt: %pattern_type.1ab = value_binding_pattern a [concrete]
// CHECK:STDOUT: %a.param_patt: %pattern_type.1ab = value_param_pattern %a.patt, call_param0 [concrete]
// CHECK:STDOUT: %a.param_patt: %pattern_type.1ab = value_param_pattern %a.patt [concrete]
// CHECK:STDOUT: %return.patt: %pattern_type.7c7 = return_slot_pattern [concrete]
// CHECK:STDOUT: %return.param_patt: %pattern_type.7c7 = out_param_pattern %return.patt, call_param1 [concrete]
// CHECK:STDOUT: %return.param_patt: %pattern_type.7c7 = out_param_pattern %return.patt [concrete]
// CHECK:STDOUT: } {
// CHECK:STDOUT: %C.ref.loc16: type = name_ref C, file.%C.decl [concrete = constants.%C]
// CHECK:STDOUT: %.loc16: Core.Form = init_form %C.ref.loc16, call_param1 [concrete = constants.%.b89]