Model Core.Int as a class type (#4644)

Instead of treating `Core.Int` as the toolchain's builtin `IntType`,
model it as a class that adapts the builtin type. This aligns us better
with the intended language model, gives an associated library for
`impl`s involving `Core.Int` to live within, and opens the door adding
member functions to `Core.Int` if we decide that is desirable.
Remarkably it also seems to make the formatted SemIR a little smaller,
because a call to a generic class generates less IR than a call to a
function.
This commit is contained in:
Richard Smith
2024-12-16 22:19:23 +00:00
committed by GitHub
parent f922988c8c
commit a10c79569e
339 changed files with 7812 additions and 11595 deletions
@@ -17,16 +17,14 @@ fn F(n: i32, a: [i32; n]*);
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template]
// CHECK:STDOUT: %Int.type: type = fn_type @Int [template]
// CHECK:STDOUT: %Int: %Int.type = struct_value () [template]
// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template]
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template]
// CHECK:STDOUT: %F.type: type = fn_type @F [template]
// CHECK:STDOUT: %F: %F.type = struct_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
// CHECK:STDOUT: .Int = %import_ref
// CHECK:STDOUT: .Int = %import_ref.1
// CHECK:STDOUT: import Core//prelude
// CHECK:STDOUT: import Core//prelude/...
// CHECK:STDOUT: }
@@ -45,14 +43,10 @@ fn F(n: i32, a: [i32; n]*);
// CHECK:STDOUT: %a.param_patt: <error> = value_param_pattern %a.patt, runtime_param1
// CHECK:STDOUT: } {
// CHECK:STDOUT: %int_32.loc14_9: Core.IntLiteral = int_value 32 [template = constants.%int_32]
// CHECK:STDOUT: %int.make_type_signed.loc14_9: init type = call constants.%Int(%int_32.loc14_9) [template = constants.%i32]
// CHECK:STDOUT: %.loc14_9.1: type = value_of_initializer %int.make_type_signed.loc14_9 [template = constants.%i32]
// CHECK:STDOUT: %.loc14_9.2: type = converted %int.make_type_signed.loc14_9, %.loc14_9.1 [template = constants.%i32]
// CHECK:STDOUT: %i32.loc14_9: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
// CHECK:STDOUT: %int_32.loc14_18: Core.IntLiteral = int_value 32 [template = constants.%int_32]
// CHECK:STDOUT: %int.make_type_signed.loc14_18: init type = call constants.%Int(%int_32.loc14_18) [template = constants.%i32]
// CHECK:STDOUT: %i32.loc14_18: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
// CHECK:STDOUT: %n.ref: %i32 = name_ref n, %n
// CHECK:STDOUT: %.loc14_18.1: type = value_of_initializer %int.make_type_signed.loc14_18 [template = constants.%i32]
// CHECK:STDOUT: %.loc14_18.2: type = converted %int.make_type_signed.loc14_18, %.loc14_18.1 [template = constants.%i32]
// CHECK:STDOUT: %ptr: type = ptr_type <error> [template = <error>]
// CHECK:STDOUT: %n.param: %i32 = value_param runtime_param0
// CHECK:STDOUT: %n: %i32 = bind_name n, %n.param
@@ -20,16 +20,14 @@ fn F(n: i32, n: i32);
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template]
// CHECK:STDOUT: %Int.type: type = fn_type @Int [template]
// CHECK:STDOUT: %Int: %Int.type = struct_value () [template]
// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template]
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template]
// CHECK:STDOUT: %F.type: type = fn_type @F [template]
// CHECK:STDOUT: %F: %F.type = struct_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
// CHECK:STDOUT: .Int = %import_ref
// CHECK:STDOUT: .Int = %import_ref.1
// CHECK:STDOUT: import Core//prelude
// CHECK:STDOUT: import Core//prelude/...
// CHECK:STDOUT: }
@@ -48,13 +46,9 @@ fn F(n: i32, n: i32);
// CHECK:STDOUT: %n.param_patt.loc17_15: %i32 = value_param_pattern %n.patt.loc17_14, runtime_param1
// CHECK:STDOUT: } {
// CHECK:STDOUT: %int_32.loc17_9: Core.IntLiteral = int_value 32 [template = constants.%int_32]
// CHECK:STDOUT: %int.make_type_signed.loc17_9: init type = call constants.%Int(%int_32.loc17_9) [template = constants.%i32]
// CHECK:STDOUT: %.loc17_9.1: type = value_of_initializer %int.make_type_signed.loc17_9 [template = constants.%i32]
// CHECK:STDOUT: %.loc17_9.2: type = converted %int.make_type_signed.loc17_9, %.loc17_9.1 [template = constants.%i32]
// CHECK:STDOUT: %i32.loc17_9: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
// CHECK:STDOUT: %int_32.loc17_17: Core.IntLiteral = int_value 32 [template = constants.%int_32]
// CHECK:STDOUT: %int.make_type_signed.loc17_17: init type = call constants.%Int(%int_32.loc17_17) [template = constants.%i32]
// CHECK:STDOUT: %.loc17_17.1: type = value_of_initializer %int.make_type_signed.loc17_17 [template = constants.%i32]
// CHECK:STDOUT: %.loc17_17.2: type = converted %int.make_type_signed.loc17_17, %.loc17_17.1 [template = constants.%i32]
// CHECK:STDOUT: %i32.loc17_17: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
// CHECK:STDOUT: %n.param.loc17_7: %i32 = value_param runtime_param0
// CHECK:STDOUT: %n.loc17_6: %i32 = bind_name n, %n.param.loc17_7
// CHECK:STDOUT: %n.param.loc17_15: %i32 = value_param runtime_param1
+78 -144
View File
@@ -261,9 +261,7 @@ import library "extern_api";
// CHECK:STDOUT: %A.type: type = fn_type @A [template]
// CHECK:STDOUT: %A: %A.type = struct_value () [template]
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template]
// CHECK:STDOUT: %Int.type: type = fn_type @Int [template]
// CHECK:STDOUT: %Int: %Int.type = struct_value () [template]
// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template]
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template]
// CHECK:STDOUT: %B.type: type = fn_type @B [template]
// CHECK:STDOUT: %B: %B.type = struct_value () [template]
// CHECK:STDOUT: %tuple.type.1: type = tuple_type (type) [template]
@@ -279,7 +277,7 @@ import library "extern_api";
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
// CHECK:STDOUT: .Int = %import_ref
// CHECK:STDOUT: .Int = %import_ref.1
// CHECK:STDOUT: import Core//prelude
// CHECK:STDOUT: import Core//prelude/...
// CHECK:STDOUT: }
@@ -303,13 +301,9 @@ import library "extern_api";
// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1
// CHECK:STDOUT: } {
// CHECK:STDOUT: %int_32.loc5_9: Core.IntLiteral = int_value 32 [template = constants.%int_32]
// CHECK:STDOUT: %int.make_type_signed.loc5_9: init type = call constants.%Int(%int_32.loc5_9) [template = constants.%i32]
// CHECK:STDOUT: %.loc5_9.1: type = value_of_initializer %int.make_type_signed.loc5_9 [template = constants.%i32]
// CHECK:STDOUT: %.loc5_9.2: type = converted %int.make_type_signed.loc5_9, %.loc5_9.1 [template = constants.%i32]
// CHECK:STDOUT: %i32.loc5_9: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
// CHECK:STDOUT: %int_32.loc5_17: Core.IntLiteral = int_value 32 [template = constants.%int_32]
// CHECK:STDOUT: %int.make_type_signed.loc5_17: init type = call constants.%Int(%int_32.loc5_17) [template = constants.%i32]
// CHECK:STDOUT: %.loc5_17.1: type = value_of_initializer %int.make_type_signed.loc5_17 [template = constants.%i32]
// CHECK:STDOUT: %.loc5_17.2: type = converted %int.make_type_signed.loc5_17, %.loc5_17.1 [template = constants.%i32]
// CHECK:STDOUT: %i32.loc5_17: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param0
// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param
// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1
@@ -322,15 +316,11 @@ import library "extern_api";
// CHECK:STDOUT: %return.param_patt: %struct_type.c = out_param_pattern %return.patt, runtime_param1
// CHECK:STDOUT: } {
// CHECK:STDOUT: %int_32.loc6_10: Core.IntLiteral = int_value 32 [template = constants.%int_32]
// CHECK:STDOUT: %int.make_type_signed.loc6_10: init type = call constants.%Int(%int_32.loc6_10) [template = constants.%i32]
// CHECK:STDOUT: %.loc6_14.1: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc6_10)
// CHECK:STDOUT: %.loc6_14.2: type = value_of_initializer %int.make_type_signed.loc6_10 [template = constants.%i32]
// CHECK:STDOUT: %.loc6_14.3: type = converted %int.make_type_signed.loc6_10, %.loc6_14.2 [template = constants.%i32]
// CHECK:STDOUT: %.loc6_14.4: type = converted %.loc6_14.1, constants.%tuple.type.2 [template = constants.%tuple.type.2]
// CHECK:STDOUT: %i32.loc6_10: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
// CHECK:STDOUT: %.loc6_14.1: %tuple.type.1 = tuple_literal (%i32.loc6_10)
// CHECK:STDOUT: %.loc6_14.2: type = converted %.loc6_14.1, constants.%tuple.type.2 [template = constants.%tuple.type.2]
// CHECK:STDOUT: %int_32.loc6_25: Core.IntLiteral = int_value 32 [template = constants.%int_32]
// CHECK:STDOUT: %int.make_type_signed.loc6_25: init type = call constants.%Int(%int_32.loc6_25) [template = constants.%i32]
// CHECK:STDOUT: %.loc6_25.1: type = value_of_initializer %int.make_type_signed.loc6_25 [template = constants.%i32]
// CHECK:STDOUT: %.loc6_25.2: type = converted %int.make_type_signed.loc6_25, %.loc6_25.1 [template = constants.%i32]
// CHECK:STDOUT: %i32.loc6_25: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
// CHECK:STDOUT: %struct_type.c: type = struct_type {.c: %i32} [template = constants.%struct_type.c]
// CHECK:STDOUT: %c.param: %tuple.type.2 = value_param runtime_param0
// CHECK:STDOUT: %c: %tuple.type.2 = bind_name c, %c.param
@@ -360,9 +350,7 @@ import library "extern_api";
// CHECK:STDOUT: %A.type: type = fn_type @A [template]
// CHECK:STDOUT: %A: %A.type = struct_value () [template]
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template]
// CHECK:STDOUT: %Int.type: type = fn_type @Int [template]
// CHECK:STDOUT: %Int: %Int.type = struct_value () [template]
// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template]
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template]
// CHECK:STDOUT: %B.type: type = fn_type @B [template]
// CHECK:STDOUT: %B: %B.type = struct_value () [template]
// CHECK:STDOUT: %tuple.type.1: type = tuple_type (type) [template]
@@ -378,7 +366,7 @@ import library "extern_api";
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
// CHECK:STDOUT: .Int = %import_ref
// CHECK:STDOUT: .Int = %import_ref.1
// CHECK:STDOUT: import Core//prelude
// CHECK:STDOUT: import Core//prelude/...
// CHECK:STDOUT: }
@@ -402,13 +390,9 @@ import library "extern_api";
// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1
// CHECK:STDOUT: } {
// CHECK:STDOUT: %int_32.loc5_44: Core.IntLiteral = int_value 32 [template = constants.%int_32]
// CHECK:STDOUT: %int.make_type_signed.loc5_44: init type = call constants.%Int(%int_32.loc5_44) [template = constants.%i32]
// CHECK:STDOUT: %.loc5_44.1: type = value_of_initializer %int.make_type_signed.loc5_44 [template = constants.%i32]
// CHECK:STDOUT: %.loc5_44.2: type = converted %int.make_type_signed.loc5_44, %.loc5_44.1 [template = constants.%i32]
// CHECK:STDOUT: %i32.loc5_44: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
// CHECK:STDOUT: %int_32.loc5_52: Core.IntLiteral = int_value 32 [template = constants.%int_32]
// CHECK:STDOUT: %int.make_type_signed.loc5_52: init type = call constants.%Int(%int_32.loc5_52) [template = constants.%i32]
// CHECK:STDOUT: %.loc5_52.1: type = value_of_initializer %int.make_type_signed.loc5_52 [template = constants.%i32]
// CHECK:STDOUT: %.loc5_52.2: type = converted %int.make_type_signed.loc5_52, %.loc5_52.1 [template = constants.%i32]
// CHECK:STDOUT: %i32.loc5_52: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param0
// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param
// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1
@@ -421,15 +405,11 @@ import library "extern_api";
// CHECK:STDOUT: %return.param_patt: %struct_type.c = out_param_pattern %return.patt, runtime_param1
// CHECK:STDOUT: } {
// CHECK:STDOUT: %int_32.loc6_45: Core.IntLiteral = int_value 32 [template = constants.%int_32]
// CHECK:STDOUT: %int.make_type_signed.loc6_45: init type = call constants.%Int(%int_32.loc6_45) [template = constants.%i32]
// CHECK:STDOUT: %.loc6_49.1: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc6_45)
// CHECK:STDOUT: %.loc6_49.2: type = value_of_initializer %int.make_type_signed.loc6_45 [template = constants.%i32]
// CHECK:STDOUT: %.loc6_49.3: type = converted %int.make_type_signed.loc6_45, %.loc6_49.2 [template = constants.%i32]
// CHECK:STDOUT: %.loc6_49.4: type = converted %.loc6_49.1, constants.%tuple.type.2 [template = constants.%tuple.type.2]
// CHECK:STDOUT: %i32.loc6_45: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
// CHECK:STDOUT: %.loc6_49.1: %tuple.type.1 = tuple_literal (%i32.loc6_45)
// CHECK:STDOUT: %.loc6_49.2: type = converted %.loc6_49.1, constants.%tuple.type.2 [template = constants.%tuple.type.2]
// CHECK:STDOUT: %int_32.loc6_60: Core.IntLiteral = int_value 32 [template = constants.%int_32]
// CHECK:STDOUT: %int.make_type_signed.loc6_60: init type = call constants.%Int(%int_32.loc6_60) [template = constants.%i32]
// CHECK:STDOUT: %.loc6_60.1: type = value_of_initializer %int.make_type_signed.loc6_60 [template = constants.%i32]
// CHECK:STDOUT: %.loc6_60.2: type = converted %int.make_type_signed.loc6_60, %.loc6_60.1 [template = constants.%i32]
// CHECK:STDOUT: %i32.loc6_60: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
// CHECK:STDOUT: %struct_type.c: type = struct_type {.c: %i32} [template = constants.%struct_type.c]
// CHECK:STDOUT: %c.param: %tuple.type.2 = value_param runtime_param0
// CHECK:STDOUT: %c: %tuple.type.2 = bind_name c, %c.param
@@ -460,17 +440,15 @@ import library "extern_api";
// CHECK:STDOUT: %A.type: type = fn_type @A [template]
// CHECK:STDOUT: %A: %A.type = struct_value () [template]
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template]
// CHECK:STDOUT: %Int.type: type = fn_type @Int [template]
// CHECK:STDOUT: %Int: %Int.type = struct_value () [template]
// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template]
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template]
// CHECK:STDOUT: %B.type: type = fn_type @B [template]
// CHECK:STDOUT: %B: %B.type = struct_value () [template]
// CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template]
// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template]
// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template]
// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template]
// CHECK:STDOUT: %interface.9: <witness> = interface_witness (%Convert.14) [template]
// CHECK:STDOUT: %Convert.bound: <bound method> = bound_method %int_1.1, %Convert.14 [template]
// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template]
// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template]
// CHECK:STDOUT: %interface.5: <witness> = interface_witness (%Convert.10) [template]
// CHECK:STDOUT: %Convert.bound: <bound method> = bound_method %int_1.1, %Convert.10 [template]
// CHECK:STDOUT: %Convert.specific_fn: <specific function> = specific_function %Convert.bound, @Convert.2(%int_32) [template]
// CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template]
// CHECK:STDOUT: %struct_type.c: type = struct_type {.c: %i32} [template]
@@ -497,7 +475,7 @@ import library "extern_api";
// CHECK:STDOUT: %import_ref.6: %E.type = import_ref Main//api, E, loaded [template = constants.%E]
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
// CHECK:STDOUT: .Int = %import_ref.7
// CHECK:STDOUT: .ImplicitAs = %import_ref.8
// CHECK:STDOUT: .ImplicitAs = %import_ref.11
// CHECK:STDOUT: import Core//prelude
// CHECK:STDOUT: import Core//prelude/...
// CHECK:STDOUT: }
@@ -524,15 +502,11 @@ import library "extern_api";
// CHECK:STDOUT: %a.var: ref %empty_tuple.type = var a
// CHECK:STDOUT: %a: ref %empty_tuple.type = bind_name a, %a.var
// CHECK:STDOUT: %int_32.loc7: Core.IntLiteral = int_value 32 [template = constants.%int_32]
// CHECK:STDOUT: %int.make_type_signed.loc7: init type = call constants.%Int(%int_32.loc7) [template = constants.%i32]
// CHECK:STDOUT: %.loc7_8.1: type = value_of_initializer %int.make_type_signed.loc7 [template = constants.%i32]
// CHECK:STDOUT: %.loc7_8.2: type = converted %int.make_type_signed.loc7, %.loc7_8.1 [template = constants.%i32]
// CHECK:STDOUT: %i32.loc7: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
// CHECK:STDOUT: %b.var: ref %i32 = var b
// CHECK:STDOUT: %b: ref %i32 = bind_name b, %b.var
// CHECK:STDOUT: %int_32.loc8: Core.IntLiteral = int_value 32 [template = constants.%int_32]
// CHECK:STDOUT: %int.make_type_signed.loc8: init type = call constants.%Int(%int_32.loc8) [template = constants.%i32]
// CHECK:STDOUT: %.loc8_13.1: type = value_of_initializer %int.make_type_signed.loc8 [template = constants.%i32]
// CHECK:STDOUT: %.loc8_13.2: type = converted %int.make_type_signed.loc8, %.loc8_13.1 [template = constants.%i32]
// CHECK:STDOUT: %i32.loc8: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
// CHECK:STDOUT: %struct_type.c: type = struct_type {.c: %i32} [template = constants.%struct_type.c]
// CHECK:STDOUT: %c.var: ref %struct_type.c = var c
// CHECK:STDOUT: %c: ref %struct_type.c = bind_name c, %c.var
@@ -563,7 +537,7 @@ import library "extern_api";
// CHECK:STDOUT: assign file.%a.var, %A.call
// CHECK:STDOUT: %B.ref: %B.type = name_ref B, imports.%import_ref.2 [template = constants.%B]
// CHECK:STDOUT: %int_1.loc7: Core.IntLiteral = int_value 1 [template = constants.%int_1.1]
// CHECK:STDOUT: %impl.elem0.loc7: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14]
// CHECK:STDOUT: %impl.elem0.loc7: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10]
// CHECK:STDOUT: %Convert.bound.loc7: <bound method> = bound_method %int_1.loc7, %impl.elem0.loc7 [template = constants.%Convert.bound]
// CHECK:STDOUT: %Convert.specific_fn.loc7: <specific function> = specific_function %Convert.bound.loc7, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn]
// CHECK:STDOUT: %int.convert_checked.loc7: init %i32 = call %Convert.specific_fn.loc7(%int_1.loc7) [template = constants.%int_1.2]
@@ -574,7 +548,7 @@ import library "extern_api";
// CHECK:STDOUT: %C.ref: %C.type = name_ref C, imports.%import_ref.3 [template = constants.%C]
// CHECK:STDOUT: %int_1.loc8: Core.IntLiteral = int_value 1 [template = constants.%int_1.1]
// CHECK:STDOUT: %.loc8_25.1: %tuple.type.2 = tuple_literal (%int_1.loc8)
// CHECK:STDOUT: %impl.elem0.loc8: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14]
// CHECK:STDOUT: %impl.elem0.loc8: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10]
// CHECK:STDOUT: %Convert.bound.loc8: <bound method> = bound_method %int_1.loc8, %impl.elem0.loc8 [template = constants.%Convert.bound]
// CHECK:STDOUT: %Convert.specific_fn.loc8: <specific function> = specific_function %Convert.bound.loc8, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn]
// CHECK:STDOUT: %int.convert_checked.loc8: init %i32 = call %Convert.specific_fn.loc8(%int_1.loc8) [template = constants.%int_1.2]
@@ -601,9 +575,7 @@ import library "extern_api";
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template]
// CHECK:STDOUT: %A: %A.type = struct_value () [template]
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template]
// CHECK:STDOUT: %Int.type: type = fn_type @Int [template]
// CHECK:STDOUT: %Int: %Int.type = struct_value () [template]
// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template]
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template]
// CHECK:STDOUT: %B.type: type = fn_type @B [template]
// CHECK:STDOUT: %B: %B.type = struct_value () [template]
// CHECK:STDOUT: %tuple.type.1: type = tuple_type (type) [template]
@@ -617,10 +589,10 @@ import library "extern_api";
// CHECK:STDOUT: %E: %E.type = struct_value () [template]
// CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template]
// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template]
// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template]
// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template]
// CHECK:STDOUT: %interface.9: <witness> = interface_witness (%Convert.14) [template]
// CHECK:STDOUT: %Convert.bound: <bound method> = bound_method %int_1.1, %Convert.14 [template]
// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template]
// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template]
// CHECK:STDOUT: %interface.5: <witness> = interface_witness (%Convert.10) [template]
// CHECK:STDOUT: %Convert.bound: <bound method> = bound_method %int_1.1, %Convert.10 [template]
// CHECK:STDOUT: %Convert.specific_fn: <specific function> = specific_function %Convert.bound, @Convert.2(%int_32) [template]
// CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template]
// CHECK:STDOUT: %tuple.type.3: type = tuple_type (Core.IntLiteral) [template]
@@ -634,7 +606,7 @@ import library "extern_api";
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
// CHECK:STDOUT: .Int = %import_ref.7
// CHECK:STDOUT: .ImplicitAs = %import_ref.8
// CHECK:STDOUT: .ImplicitAs = %import_ref.11
// CHECK:STDOUT: import Core//prelude
// CHECK:STDOUT: import Core//prelude/...
// CHECK:STDOUT: }
@@ -659,13 +631,9 @@ import library "extern_api";
// CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {} {}
// CHECK:STDOUT: %B.decl: %B.type = fn_decl @B [template = constants.%B] {} {
// CHECK:STDOUT: %int_32.loc23_16: Core.IntLiteral = int_value 32 [template = constants.%int_32]
// CHECK:STDOUT: %int.make_type_signed.loc23_16: init type = call constants.%Int(%int_32.loc23_16) [template = constants.%i32]
// CHECK:STDOUT: %.loc23_16.1: type = value_of_initializer %int.make_type_signed.loc23_16 [template = constants.%i32]
// CHECK:STDOUT: %.loc23_16.2: type = converted %int.make_type_signed.loc23_16, %.loc23_16.1 [template = constants.%i32]
// CHECK:STDOUT: %i32.loc23_16: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
// CHECK:STDOUT: %int_32.loc23_24: Core.IntLiteral = int_value 32 [template = constants.%int_32]
// CHECK:STDOUT: %int.make_type_signed.loc23_24: init type = call constants.%Int(%int_32.loc23_24) [template = constants.%i32]
// CHECK:STDOUT: %.loc23_24.1: type = value_of_initializer %int.make_type_signed.loc23_24 [template = constants.%i32]
// CHECK:STDOUT: %.loc23_24.2: type = converted %int.make_type_signed.loc23_24, %.loc23_24.1 [template = constants.%i32]
// CHECK:STDOUT: %i32.loc23_24: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param0
// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param
// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1
@@ -673,15 +641,11 @@ import library "extern_api";
// CHECK:STDOUT: }
// CHECK:STDOUT: %C.decl: %C.type = fn_decl @C [template = constants.%C] {} {
// CHECK:STDOUT: %int_32.loc32_17: Core.IntLiteral = int_value 32 [template = constants.%int_32]
// CHECK:STDOUT: %int.make_type_signed.loc32_17: init type = call constants.%Int(%int_32.loc32_17) [template = constants.%i32]
// CHECK:STDOUT: %.loc32_21.1: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc32_17)
// CHECK:STDOUT: %.loc32_21.2: type = value_of_initializer %int.make_type_signed.loc32_17 [template = constants.%i32]
// CHECK:STDOUT: %.loc32_21.3: type = converted %int.make_type_signed.loc32_17, %.loc32_21.2 [template = constants.%i32]
// CHECK:STDOUT: %.loc32_21.4: type = converted %.loc32_21.1, constants.%tuple.type.2 [template = constants.%tuple.type.2]
// CHECK:STDOUT: %i32.loc32_17: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
// CHECK:STDOUT: %.loc32_21.1: %tuple.type.1 = tuple_literal (%i32.loc32_17)
// CHECK:STDOUT: %.loc32_21.2: type = converted %.loc32_21.1, constants.%tuple.type.2 [template = constants.%tuple.type.2]
// CHECK:STDOUT: %int_32.loc32_32: Core.IntLiteral = int_value 32 [template = constants.%int_32]
// CHECK:STDOUT: %int.make_type_signed.loc32_32: init type = call constants.%Int(%int_32.loc32_32) [template = constants.%i32]
// CHECK:STDOUT: %.loc32_32.1: type = value_of_initializer %int.make_type_signed.loc32_32 [template = constants.%i32]
// CHECK:STDOUT: %.loc32_32.2: type = converted %int.make_type_signed.loc32_32, %.loc32_32.1 [template = constants.%i32]
// CHECK:STDOUT: %i32.loc32_32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
// CHECK:STDOUT: %struct_type.c: type = struct_type {.c: %i32} [template = constants.%struct_type.c]
// CHECK:STDOUT: %c.param: %tuple.type.2 = value_param runtime_param0
// CHECK:STDOUT: %c: %tuple.type.2 = bind_name c, %c.param
@@ -695,15 +659,11 @@ import library "extern_api";
// CHECK:STDOUT: %a.var: ref %empty_tuple.type = var a
// CHECK:STDOUT: %a: ref %empty_tuple.type = bind_name a, %a.var
// CHECK:STDOUT: %int_32.loc53: Core.IntLiteral = int_value 32 [template = constants.%int_32]
// CHECK:STDOUT: %int.make_type_signed.loc53: init type = call constants.%Int(%int_32.loc53) [template = constants.%i32]
// CHECK:STDOUT: %.loc53_8.1: type = value_of_initializer %int.make_type_signed.loc53 [template = constants.%i32]
// CHECK:STDOUT: %.loc53_8.2: type = converted %int.make_type_signed.loc53, %.loc53_8.1 [template = constants.%i32]
// CHECK:STDOUT: %i32.loc53: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
// CHECK:STDOUT: %b.var: ref %i32 = var b
// CHECK:STDOUT: %b: ref %i32 = bind_name b, %b.var
// CHECK:STDOUT: %int_32.loc54: Core.IntLiteral = int_value 32 [template = constants.%int_32]
// CHECK:STDOUT: %int.make_type_signed.loc54: init type = call constants.%Int(%int_32.loc54) [template = constants.%i32]
// CHECK:STDOUT: %.loc54_13.1: type = value_of_initializer %int.make_type_signed.loc54 [template = constants.%i32]
// CHECK:STDOUT: %.loc54_13.2: type = converted %int.make_type_signed.loc54, %.loc54_13.1 [template = constants.%i32]
// CHECK:STDOUT: %i32.loc54: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
// CHECK:STDOUT: %struct_type.c: type = struct_type {.c: %i32} [template = constants.%struct_type.c]
// CHECK:STDOUT: %c.var: ref %struct_type.c = var c
// CHECK:STDOUT: %c: ref %struct_type.c = bind_name c, %c.var
@@ -734,7 +694,7 @@ import library "extern_api";
// CHECK:STDOUT: assign file.%a.var, %A.call
// CHECK:STDOUT: %B.ref: %B.type = name_ref B, file.%B.decl [template = constants.%B]
// CHECK:STDOUT: %int_1.loc53: Core.IntLiteral = int_value 1 [template = constants.%int_1.1]
// CHECK:STDOUT: %impl.elem0.loc53: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14]
// CHECK:STDOUT: %impl.elem0.loc53: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10]
// CHECK:STDOUT: %Convert.bound.loc53: <bound method> = bound_method %int_1.loc53, %impl.elem0.loc53 [template = constants.%Convert.bound]
// CHECK:STDOUT: %Convert.specific_fn.loc53: <specific function> = specific_function %Convert.bound.loc53, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn]
// CHECK:STDOUT: %int.convert_checked.loc53: init %i32 = call %Convert.specific_fn.loc53(%int_1.loc53) [template = constants.%int_1.2]
@@ -745,7 +705,7 @@ import library "extern_api";
// CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [template = constants.%C]
// CHECK:STDOUT: %int_1.loc54: Core.IntLiteral = int_value 1 [template = constants.%int_1.1]
// CHECK:STDOUT: %.loc54_25.1: %tuple.type.3 = tuple_literal (%int_1.loc54)
// CHECK:STDOUT: %impl.elem0.loc54: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14]
// CHECK:STDOUT: %impl.elem0.loc54: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10]
// CHECK:STDOUT: %Convert.bound.loc54: <bound method> = bound_method %int_1.loc54, %impl.elem0.loc54 [template = constants.%Convert.bound]
// CHECK:STDOUT: %Convert.specific_fn.loc54: <specific function> = specific_function %Convert.bound.loc54, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn]
// CHECK:STDOUT: %int.convert_checked.loc54: init %i32 = call %Convert.specific_fn.loc54(%int_1.loc54) [template = constants.%int_1.2]
@@ -772,9 +732,7 @@ import library "extern_api";
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template]
// CHECK:STDOUT: %A: %A.type = struct_value () [template]
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template]
// CHECK:STDOUT: %Int.type: type = fn_type @Int [template]
// CHECK:STDOUT: %Int: %Int.type = struct_value () [template]
// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template]
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template]
// CHECK:STDOUT: %B.type: type = fn_type @B [template]
// CHECK:STDOUT: %B: %B.type = struct_value () [template]
// CHECK:STDOUT: %tuple.type.1: type = tuple_type (type) [template]
@@ -788,10 +746,10 @@ import library "extern_api";
// CHECK:STDOUT: %E: %E.type = struct_value () [template]
// CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template]
// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template]
// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template]
// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template]
// CHECK:STDOUT: %interface.9: <witness> = interface_witness (%Convert.14) [template]
// CHECK:STDOUT: %Convert.bound: <bound method> = bound_method %int_1.1, %Convert.14 [template]
// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template]
// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template]
// CHECK:STDOUT: %interface.5: <witness> = interface_witness (%Convert.10) [template]
// CHECK:STDOUT: %Convert.bound: <bound method> = bound_method %int_1.1, %Convert.10 [template]
// CHECK:STDOUT: %Convert.specific_fn: <specific function> = specific_function %Convert.bound, @Convert.2(%int_32) [template]
// CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template]
// CHECK:STDOUT: %tuple.type.3: type = tuple_type (Core.IntLiteral) [template]
@@ -805,7 +763,7 @@ import library "extern_api";
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
// CHECK:STDOUT: .Int = %import_ref.7
// CHECK:STDOUT: .ImplicitAs = %import_ref.8
// CHECK:STDOUT: .ImplicitAs = %import_ref.11
// CHECK:STDOUT: import Core//prelude
// CHECK:STDOUT: import Core//prelude/...
// CHECK:STDOUT: }
@@ -830,13 +788,9 @@ import library "extern_api";
// CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {} {}
// CHECK:STDOUT: %B.decl: %B.type = fn_decl @B [template = constants.%B] {} {
// CHECK:STDOUT: %int_32.loc7_16: Core.IntLiteral = int_value 32 [template = constants.%int_32]
// CHECK:STDOUT: %int.make_type_signed.loc7_16: init type = call constants.%Int(%int_32.loc7_16) [template = constants.%i32]
// CHECK:STDOUT: %.loc7_16.1: type = value_of_initializer %int.make_type_signed.loc7_16 [template = constants.%i32]
// CHECK:STDOUT: %.loc7_16.2: type = converted %int.make_type_signed.loc7_16, %.loc7_16.1 [template = constants.%i32]
// CHECK:STDOUT: %i32.loc7_16: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
// CHECK:STDOUT: %int_32.loc7_24: Core.IntLiteral = int_value 32 [template = constants.%int_32]
// CHECK:STDOUT: %int.make_type_signed.loc7_24: init type = call constants.%Int(%int_32.loc7_24) [template = constants.%i32]
// CHECK:STDOUT: %.loc7_24.1: type = value_of_initializer %int.make_type_signed.loc7_24 [template = constants.%i32]
// CHECK:STDOUT: %.loc7_24.2: type = converted %int.make_type_signed.loc7_24, %.loc7_24.1 [template = constants.%i32]
// CHECK:STDOUT: %i32.loc7_24: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param0
// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param
// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1
@@ -844,15 +798,11 @@ import library "extern_api";
// CHECK:STDOUT: }
// CHECK:STDOUT: %C.decl: %C.type = fn_decl @C [template = constants.%C] {} {
// CHECK:STDOUT: %int_32.loc8_17: Core.IntLiteral = int_value 32 [template = constants.%int_32]
// CHECK:STDOUT: %int.make_type_signed.loc8_17: init type = call constants.%Int(%int_32.loc8_17) [template = constants.%i32]
// CHECK:STDOUT: %.loc8_21.1: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc8_17)
// CHECK:STDOUT: %.loc8_21.2: type = value_of_initializer %int.make_type_signed.loc8_17 [template = constants.%i32]
// CHECK:STDOUT: %.loc8_21.3: type = converted %int.make_type_signed.loc8_17, %.loc8_21.2 [template = constants.%i32]
// CHECK:STDOUT: %.loc8_21.4: type = converted %.loc8_21.1, constants.%tuple.type.2 [template = constants.%tuple.type.2]
// CHECK:STDOUT: %i32.loc8_17: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
// CHECK:STDOUT: %.loc8_21.1: %tuple.type.1 = tuple_literal (%i32.loc8_17)
// CHECK:STDOUT: %.loc8_21.2: type = converted %.loc8_21.1, constants.%tuple.type.2 [template = constants.%tuple.type.2]
// CHECK:STDOUT: %int_32.loc8_32: Core.IntLiteral = int_value 32 [template = constants.%int_32]
// CHECK:STDOUT: %int.make_type_signed.loc8_32: init type = call constants.%Int(%int_32.loc8_32) [template = constants.%i32]
// CHECK:STDOUT: %.loc8_32.1: type = value_of_initializer %int.make_type_signed.loc8_32 [template = constants.%i32]
// CHECK:STDOUT: %.loc8_32.2: type = converted %int.make_type_signed.loc8_32, %.loc8_32.1 [template = constants.%i32]
// CHECK:STDOUT: %i32.loc8_32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
// CHECK:STDOUT: %struct_type.c: type = struct_type {.c: %i32} [template = constants.%struct_type.c]
// CHECK:STDOUT: %c.param: %tuple.type.2 = value_param runtime_param0
// CHECK:STDOUT: %c: %tuple.type.2 = bind_name c, %c.param
@@ -866,15 +816,11 @@ import library "extern_api";
// CHECK:STDOUT: %a.var: ref %empty_tuple.type = var a
// CHECK:STDOUT: %a: ref %empty_tuple.type = bind_name a, %a.var
// CHECK:STDOUT: %int_32.loc13: Core.IntLiteral = int_value 32 [template = constants.%int_32]
// CHECK:STDOUT: %int.make_type_signed.loc13: init type = call constants.%Int(%int_32.loc13) [template = constants.%i32]
// CHECK:STDOUT: %.loc13_8.1: type = value_of_initializer %int.make_type_signed.loc13 [template = constants.%i32]
// CHECK:STDOUT: %.loc13_8.2: type = converted %int.make_type_signed.loc13, %.loc13_8.1 [template = constants.%i32]
// CHECK:STDOUT: %i32.loc13: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
// CHECK:STDOUT: %b.var: ref %i32 = var b
// CHECK:STDOUT: %b: ref %i32 = bind_name b, %b.var
// CHECK:STDOUT: %int_32.loc14: Core.IntLiteral = int_value 32 [template = constants.%int_32]
// CHECK:STDOUT: %int.make_type_signed.loc14: init type = call constants.%Int(%int_32.loc14) [template = constants.%i32]
// CHECK:STDOUT: %.loc14_13.1: type = value_of_initializer %int.make_type_signed.loc14 [template = constants.%i32]
// CHECK:STDOUT: %.loc14_13.2: type = converted %int.make_type_signed.loc14, %.loc14_13.1 [template = constants.%i32]
// CHECK:STDOUT: %i32.loc14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
// CHECK:STDOUT: %struct_type.c: type = struct_type {.c: %i32} [template = constants.%struct_type.c]
// CHECK:STDOUT: %c.var: ref %struct_type.c = var c
// CHECK:STDOUT: %c: ref %struct_type.c = bind_name c, %c.var
@@ -905,7 +851,7 @@ import library "extern_api";
// CHECK:STDOUT: assign file.%a.var, %A.call
// CHECK:STDOUT: %B.ref: %B.type = name_ref B, file.%B.decl [template = constants.%B]
// CHECK:STDOUT: %int_1.loc13: Core.IntLiteral = int_value 1 [template = constants.%int_1.1]
// CHECK:STDOUT: %impl.elem0.loc13: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14]
// CHECK:STDOUT: %impl.elem0.loc13: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10]
// CHECK:STDOUT: %Convert.bound.loc13: <bound method> = bound_method %int_1.loc13, %impl.elem0.loc13 [template = constants.%Convert.bound]
// CHECK:STDOUT: %Convert.specific_fn.loc13: <specific function> = specific_function %Convert.bound.loc13, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn]
// CHECK:STDOUT: %int.convert_checked.loc13: init %i32 = call %Convert.specific_fn.loc13(%int_1.loc13) [template = constants.%int_1.2]
@@ -916,7 +862,7 @@ import library "extern_api";
// CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [template = constants.%C]
// CHECK:STDOUT: %int_1.loc14: Core.IntLiteral = int_value 1 [template = constants.%int_1.1]
// CHECK:STDOUT: %.loc14_25.1: %tuple.type.3 = tuple_literal (%int_1.loc14)
// CHECK:STDOUT: %impl.elem0.loc14: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14]
// CHECK:STDOUT: %impl.elem0.loc14: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10]
// CHECK:STDOUT: %Convert.bound.loc14: <bound method> = bound_method %int_1.loc14, %impl.elem0.loc14 [template = constants.%Convert.bound]
// CHECK:STDOUT: %Convert.specific_fn.loc14: <specific function> = specific_function %Convert.bound.loc14, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn]
// CHECK:STDOUT: %int.convert_checked.loc14: init %i32 = call %Convert.specific_fn.loc14(%int_1.loc14) [template = constants.%int_1.2]
@@ -943,17 +889,15 @@ import library "extern_api";
// CHECK:STDOUT: %A.type: type = fn_type @A [template]
// CHECK:STDOUT: %A: %A.type = struct_value () [template]
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template]
// CHECK:STDOUT: %Int.type: type = fn_type @Int [template]
// CHECK:STDOUT: %Int: %Int.type = struct_value () [template]
// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template]
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template]
// CHECK:STDOUT: %B.type: type = fn_type @B [template]
// CHECK:STDOUT: %B: %B.type = struct_value () [template]
// CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template]
// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template]
// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template]
// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template]
// CHECK:STDOUT: %interface.9: <witness> = interface_witness (%Convert.14) [template]
// CHECK:STDOUT: %Convert.bound: <bound method> = bound_method %int_1.1, %Convert.14 [template]
// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template]
// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template]
// CHECK:STDOUT: %interface.5: <witness> = interface_witness (%Convert.10) [template]
// CHECK:STDOUT: %Convert.bound: <bound method> = bound_method %int_1.1, %Convert.10 [template]
// CHECK:STDOUT: %Convert.specific_fn: <specific function> = specific_function %Convert.bound, @Convert.2(%int_32) [template]
// CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template]
// CHECK:STDOUT: %struct_type.c: type = struct_type {.c: %i32} [template]
@@ -980,7 +924,7 @@ import library "extern_api";
// CHECK:STDOUT: %import_ref.6: %E.type = import_ref Main//api, E, loaded [template = constants.%E]
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
// CHECK:STDOUT: .Int = %import_ref.12
// CHECK:STDOUT: .ImplicitAs = %import_ref.13
// CHECK:STDOUT: .ImplicitAs = %import_ref.16
// CHECK:STDOUT: import Core//prelude
// CHECK:STDOUT: import Core//prelude/...
// CHECK:STDOUT: }
@@ -1007,15 +951,11 @@ import library "extern_api";
// CHECK:STDOUT: %a.var: ref %empty_tuple.type = var a
// CHECK:STDOUT: %a: ref %empty_tuple.type = bind_name a, %a.var
// CHECK:STDOUT: %int_32.loc53: Core.IntLiteral = int_value 32 [template = constants.%int_32]
// CHECK:STDOUT: %int.make_type_signed.loc53: init type = call constants.%Int(%int_32.loc53) [template = constants.%i32]
// CHECK:STDOUT: %.loc53_8.1: type = value_of_initializer %int.make_type_signed.loc53 [template = constants.%i32]
// CHECK:STDOUT: %.loc53_8.2: type = converted %int.make_type_signed.loc53, %.loc53_8.1 [template = constants.%i32]
// CHECK:STDOUT: %i32.loc53: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
// CHECK:STDOUT: %b.var: ref %i32 = var b
// CHECK:STDOUT: %b: ref %i32 = bind_name b, %b.var
// CHECK:STDOUT: %int_32.loc54: Core.IntLiteral = int_value 32 [template = constants.%int_32]
// CHECK:STDOUT: %int.make_type_signed.loc54: init type = call constants.%Int(%int_32.loc54) [template = constants.%i32]
// CHECK:STDOUT: %.loc54_13.1: type = value_of_initializer %int.make_type_signed.loc54 [template = constants.%i32]
// CHECK:STDOUT: %.loc54_13.2: type = converted %int.make_type_signed.loc54, %.loc54_13.1 [template = constants.%i32]
// CHECK:STDOUT: %i32.loc54: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
// CHECK:STDOUT: %struct_type.c: type = struct_type {.c: %i32} [template = constants.%struct_type.c]
// CHECK:STDOUT: %c.var: ref %struct_type.c = var c
// CHECK:STDOUT: %c: ref %struct_type.c = bind_name c, %c.var
@@ -1046,7 +986,7 @@ import library "extern_api";
// CHECK:STDOUT: assign file.%a.var, %A.call
// CHECK:STDOUT: %B.ref: %B.type = name_ref B, imports.%import_ref.2 [template = constants.%B]
// CHECK:STDOUT: %int_1.loc53: Core.IntLiteral = int_value 1 [template = constants.%int_1.1]
// CHECK:STDOUT: %impl.elem0.loc53: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14]
// CHECK:STDOUT: %impl.elem0.loc53: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10]
// CHECK:STDOUT: %Convert.bound.loc53: <bound method> = bound_method %int_1.loc53, %impl.elem0.loc53 [template = constants.%Convert.bound]
// CHECK:STDOUT: %Convert.specific_fn.loc53: <specific function> = specific_function %Convert.bound.loc53, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn]
// CHECK:STDOUT: %int.convert_checked.loc53: init %i32 = call %Convert.specific_fn.loc53(%int_1.loc53) [template = constants.%int_1.2]
@@ -1057,7 +997,7 @@ import library "extern_api";
// CHECK:STDOUT: %C.ref: %C.type = name_ref C, imports.%import_ref.3 [template = constants.%C]
// CHECK:STDOUT: %int_1.loc54: Core.IntLiteral = int_value 1 [template = constants.%int_1.1]
// CHECK:STDOUT: %.loc54_25.1: %tuple.type.2 = tuple_literal (%int_1.loc54)
// CHECK:STDOUT: %impl.elem0.loc54: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14]
// CHECK:STDOUT: %impl.elem0.loc54: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10]
// CHECK:STDOUT: %Convert.bound.loc54: <bound method> = bound_method %int_1.loc54, %impl.elem0.loc54 [template = constants.%Convert.bound]
// CHECK:STDOUT: %Convert.specific_fn.loc54: <specific function> = specific_function %Convert.bound.loc54, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn]
// CHECK:STDOUT: %int.convert_checked.loc54: init %i32 = call %Convert.specific_fn.loc54(%int_1.loc54) [template = constants.%int_1.2]
@@ -1084,17 +1024,15 @@ import library "extern_api";
// CHECK:STDOUT: %A.type: type = fn_type @A [template]
// CHECK:STDOUT: %A: %A.type = struct_value () [template]
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template]
// CHECK:STDOUT: %Int.type: type = fn_type @Int [template]
// CHECK:STDOUT: %Int: %Int.type = struct_value () [template]
// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template]
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template]
// CHECK:STDOUT: %B.type: type = fn_type @B [template]
// CHECK:STDOUT: %B: %B.type = struct_value () [template]
// CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template]
// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template]
// CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%int_32) [template]
// CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template]
// CHECK:STDOUT: %interface.9: <witness> = interface_witness (%Convert.14) [template]
// CHECK:STDOUT: %Convert.bound: <bound method> = bound_method %int_1.1, %Convert.14 [template]
// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template]
// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template]
// CHECK:STDOUT: %interface.5: <witness> = interface_witness (%Convert.10) [template]
// CHECK:STDOUT: %Convert.bound: <bound method> = bound_method %int_1.1, %Convert.10 [template]
// CHECK:STDOUT: %Convert.specific_fn: <specific function> = specific_function %Convert.bound, @Convert.2(%int_32) [template]
// CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template]
// CHECK:STDOUT: %struct_type.c: type = struct_type {.c: %i32} [template]
@@ -1121,7 +1059,7 @@ import library "extern_api";
// CHECK:STDOUT: %import_ref.6: %E.type = import_ref Main//extern_api, E, loaded [template = constants.%E]
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
// CHECK:STDOUT: .Int = %import_ref.12
// CHECK:STDOUT: .ImplicitAs = %import_ref.13
// CHECK:STDOUT: .ImplicitAs = %import_ref.16
// CHECK:STDOUT: import Core//prelude
// CHECK:STDOUT: import Core//prelude/...
// CHECK:STDOUT: }
@@ -1148,15 +1086,11 @@ import library "extern_api";
// CHECK:STDOUT: %a.var: ref %empty_tuple.type = var a
// CHECK:STDOUT: %a: ref %empty_tuple.type = bind_name a, %a.var
// CHECK:STDOUT: %int_32.loc52: Core.IntLiteral = int_value 32 [template = constants.%int_32]
// CHECK:STDOUT: %int.make_type_signed.loc52: init type = call constants.%Int(%int_32.loc52) [template = constants.%i32]
// CHECK:STDOUT: %.loc52_8.1: type = value_of_initializer %int.make_type_signed.loc52 [template = constants.%i32]
// CHECK:STDOUT: %.loc52_8.2: type = converted %int.make_type_signed.loc52, %.loc52_8.1 [template = constants.%i32]
// CHECK:STDOUT: %i32.loc52: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
// CHECK:STDOUT: %b.var: ref %i32 = var b
// CHECK:STDOUT: %b: ref %i32 = bind_name b, %b.var
// CHECK:STDOUT: %int_32.loc53: Core.IntLiteral = int_value 32 [template = constants.%int_32]
// CHECK:STDOUT: %int.make_type_signed.loc53: init type = call constants.%Int(%int_32.loc53) [template = constants.%i32]
// CHECK:STDOUT: %.loc53_13.1: type = value_of_initializer %int.make_type_signed.loc53 [template = constants.%i32]
// CHECK:STDOUT: %.loc53_13.2: type = converted %int.make_type_signed.loc53, %.loc53_13.1 [template = constants.%i32]
// CHECK:STDOUT: %i32.loc53: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
// CHECK:STDOUT: %struct_type.c: type = struct_type {.c: %i32} [template = constants.%struct_type.c]
// CHECK:STDOUT: %c.var: ref %struct_type.c = var c
// CHECK:STDOUT: %c: ref %struct_type.c = bind_name c, %c.var
@@ -1187,7 +1121,7 @@ import library "extern_api";
// CHECK:STDOUT: assign file.%a.var, %A.call
// CHECK:STDOUT: %B.ref: %B.type = name_ref B, imports.%import_ref.2 [template = constants.%B]
// CHECK:STDOUT: %int_1.loc52: Core.IntLiteral = int_value 1 [template = constants.%int_1.1]
// CHECK:STDOUT: %impl.elem0.loc52: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14]
// CHECK:STDOUT: %impl.elem0.loc52: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10]
// CHECK:STDOUT: %Convert.bound.loc52: <bound method> = bound_method %int_1.loc52, %impl.elem0.loc52 [template = constants.%Convert.bound]
// CHECK:STDOUT: %Convert.specific_fn.loc52: <specific function> = specific_function %Convert.bound.loc52, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn]
// CHECK:STDOUT: %int.convert_checked.loc52: init %i32 = call %Convert.specific_fn.loc52(%int_1.loc52) [template = constants.%int_1.2]
@@ -1198,7 +1132,7 @@ import library "extern_api";
// CHECK:STDOUT: %C.ref: %C.type = name_ref C, imports.%import_ref.3 [template = constants.%C]
// CHECK:STDOUT: %int_1.loc53: Core.IntLiteral = int_value 1 [template = constants.%int_1.1]
// CHECK:STDOUT: %.loc53_25.1: %tuple.type.2 = tuple_literal (%int_1.loc53)
// CHECK:STDOUT: %impl.elem0.loc53: %Convert.type.2 = interface_witness_access constants.%interface.9, element0 [template = constants.%Convert.14]
// CHECK:STDOUT: %impl.elem0.loc53: %Convert.type.2 = interface_witness_access constants.%interface.5, element0 [template = constants.%Convert.10]
// CHECK:STDOUT: %Convert.bound.loc53: <bound method> = bound_method %int_1.loc53, %impl.elem0.loc53 [template = constants.%Convert.bound]
// CHECK:STDOUT: %Convert.specific_fn.loc53: <specific function> = specific_function %Convert.bound.loc53, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn]
// CHECK:STDOUT: %int.convert_checked.loc53: init %i32 = call %Convert.specific_fn.loc53(%int_1.loc53) [template = constants.%int_1.2]
@@ -16,9 +16,7 @@ fn G(a: i32);
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template]
// CHECK:STDOUT: %Int.type: type = fn_type @Int [template]
// CHECK:STDOUT: %Int: %Int.type = struct_value () [template]
// CHECK:STDOUT: %i32: type = int_type signed, %int_32 [template]
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template]
// CHECK:STDOUT: %F.type: type = fn_type @F [template]
// CHECK:STDOUT: %F: %F.type = struct_value () [template]
// CHECK:STDOUT: %G.type: type = fn_type @G [template]
@@ -27,7 +25,7 @@ fn G(a: i32);
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
// CHECK:STDOUT: .Int = %import_ref
// CHECK:STDOUT: .Int = %import_ref.1
// CHECK:STDOUT: import Core//prelude
// CHECK:STDOUT: import Core//prelude/...
// CHECK:STDOUT: }
@@ -45,9 +43,7 @@ fn G(a: i32);
// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0
// CHECK:STDOUT: } {
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32]
// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32]
// CHECK:STDOUT: %.loc11_9.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32]
// CHECK:STDOUT: %.loc11_9.2: type = converted %int.make_type_signed, %.loc11_9.1 [template = constants.%i32]
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0
// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param
// CHECK:STDOUT: }
@@ -56,9 +52,7 @@ fn G(a: i32);
// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0
// CHECK:STDOUT: } {
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32]
// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32]
// CHECK:STDOUT: %.loc13_9.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32]
// CHECK:STDOUT: %.loc13_9.2: type = converted %int.make_type_signed, %.loc13_9.1 [template = constants.%i32]
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0
// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param
// CHECK:STDOUT: }