Skip to content

Commit

Permalink
Remove the special case for i32. (#4543)
Browse files Browse the repository at this point in the history
For the few remaining uses of the builtin `i32` type, manually build an
`IntType(Signed, 32)` value instead. These are:

- The return type of `Run`.
- The type that int literals in an `if` expression are converted into.
- The type of an array index expression.

We should consider converting those three cases away from `i32` over
time.

---------

Co-authored-by: Jon Ross-Perkins <[email protected]>
  • Loading branch information
zygoloid and jonmeow authored Nov 18, 2024
1 parent b5368b3 commit e2ae5f2
Show file tree
Hide file tree
Showing 348 changed files with 29,330 additions and 26,511 deletions.
16 changes: 0 additions & 16 deletions core/prelude/operators/as.carbon
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@ interface ImplicitAs(Dest:! type) {

// TODO: These impls should live with Core.Int, but currently that's a builtin
// not a class type, so there is no other library these can go in.
impl IntLiteral() as ImplicitAs(i32) {
fn Convert[self: Self]() -> i32 = "int.convert_checked";
}

impl forall [N:! IntLiteral()] IntLiteral() as ImplicitAs(Int(N)) {
fn Convert[self: Self]() -> Int(N) = "int.convert_checked";
}
Expand All @@ -31,10 +27,6 @@ impl forall [N:! IntLiteral()] IntLiteral() as ImplicitAs(UInt(N)) {
fn Convert[self: Self]() -> UInt(N) = "int.convert_checked";
}

impl i32 as ImplicitAs(IntLiteral()) {
fn Convert[self: Self]() -> IntLiteral() = "int.convert_checked";
}

impl forall [N:! IntLiteral()] Int(N) as ImplicitAs(IntLiteral()) {
fn Convert[self: Self]() -> IntLiteral() = "int.convert_checked";
}
Expand All @@ -44,10 +36,6 @@ impl forall [N:! IntLiteral()] UInt(N) as ImplicitAs(IntLiteral()) {
}

// TODO: Remove these once ImplicitAs extends As.
impl IntLiteral() as As(i32) {
fn Convert[self: Self]() -> i32 = "int.convert_checked";
}

impl forall [N:! IntLiteral()] IntLiteral() as As(Int(N)) {
fn Convert[self: Self]() -> Int(N) = "int.convert_checked";
}
Expand All @@ -56,10 +44,6 @@ impl forall [N:! IntLiteral()] IntLiteral() as As(UInt(N)) {
fn Convert[self: Self]() -> UInt(N) = "int.convert_checked";
}

impl i32 as As(IntLiteral()) {
fn Convert[self: Self]() -> IntLiteral() = "int.convert_checked";
}

impl forall [N:! IntLiteral()] Int(N) as As(IntLiteral()) {
fn Convert[self: Self]() -> IntLiteral() = "int.convert_checked";
}
Expand Down
1 change: 0 additions & 1 deletion core/prelude/types.carbon
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ export import library "prelude/types/bool";
// import library "prelude/types/i32";

fn IntLiteral() -> type = "int_literal.make_type";
fn Int32() -> type = "int.make_type_32";
fn Int(size: IntLiteral()) -> type = "int.make_type_signed";
fn UInt(size: IntLiteral()) -> type = "int.make_type_unsigned";
fn Float(size: IntLiteral()) -> type = "float.make_type";
2 changes: 1 addition & 1 deletion core/prelude/types/i32.carbon
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

package Core library "prelude/types/i32";

// For Int32():
// For Int():
import library "prelude/types";
import library "prelude/operators";

Expand Down
12 changes: 11 additions & 1 deletion toolchain/check/context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1010,7 +1010,6 @@ class TypeCompleter {
case SemIR::BuiltinInstKind::Invalid:
case SemIR::BuiltinInstKind::BoolType:
case SemIR::BuiltinInstKind::IntLiteralType:
case SemIR::BuiltinInstKind::IntType:
case SemIR::BuiltinInstKind::FloatType:
case SemIR::BuiltinInstKind::NamespaceType:
case SemIR::BuiltinInstKind::BoundMethodType:
Expand Down Expand Up @@ -1368,6 +1367,17 @@ auto Context::GetGenericInterfaceType(SemIR::InterfaceId interface_id,
*this, interface_id, enclosing_specific_id);
}

auto Context::GetInt32Type() -> SemIR::TypeId {
auto bit_width_const_id = TryEvalInst(
*this, SemIR::InstId::Invalid,
SemIR::IntValue{
.type_id = GetBuiltinType(SemIR::BuiltinInstKind::IntLiteralType),
.int_id = ints().Add(32)});
return GetCompleteTypeImpl<SemIR::IntType>(
*this, SemIR::IntKind::Signed,
constant_values().GetInstId(bit_width_const_id));
}

auto Context::GetInterfaceType(SemIR::InterfaceId interface_id,
SemIR::SpecificId specific_id) -> SemIR::TypeId {
return GetTypeImpl<SemIR::FacetType>(
Expand Down
3 changes: 3 additions & 0 deletions toolchain/check/context.h
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,9 @@ class Context {
SemIR::SpecificId enclosing_specific_id)
-> SemIR::TypeId;

// Returns the type `i32`.
auto GetInt32Type() -> SemIR::TypeId;

// Gets the facet type corresponding to a particular interface.
auto GetInterfaceType(SemIR::InterfaceId interface_id,
SemIR::SpecificId specific_id) -> SemIR::TypeId;
Expand Down
6 changes: 3 additions & 3 deletions toolchain/check/convert.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,9 @@ static auto MakeElementAccessInst(Context& context, SemIR::LocId loc_id,
// index so that we don't need an integer literal instruction here, and
// remove this special case.
auto index_id = block.template AddInst<SemIR::IntValue>(
loc_id,
{.type_id = context.GetBuiltinType(SemIR::BuiltinInstKind::IntType),
.int_id = context.ints().AddUnsigned(llvm::APInt(32, i))});
loc_id, {.type_id = context.GetBuiltinType(
SemIR::BuiltinInstKind::IntLiteralType),
.int_id = context.ints().Add(static_cast<int64_t>(i))});
return block.template AddInst<AccessInstT>(
loc_id, {elem_type_id, aggregate_id, index_id});
} else {
Expand Down
4 changes: 0 additions & 4 deletions toolchain/check/eval.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1057,10 +1057,6 @@ static auto MakeConstantForBuiltinCall(Context& context, SemIRLoc loc,
SemIR::InstId::BuiltinIntLiteralType);
}

case SemIR::BuiltinFunctionKind::IntMakeType32: {
return context.constant_values().Get(SemIR::InstId::BuiltinIntType);
}

case SemIR::BuiltinFunctionKind::IntMakeTypeSigned: {
return MakeIntTypeResult(context, loc, SemIR::IntKind::Signed, arg_ids[0],
phase);
Expand Down
3 changes: 1 addition & 2 deletions toolchain/check/handle_function.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -300,8 +300,7 @@ static auto BuildFunctionDecl(Context& context,
!function_info.param_patterns_id.is_valid() ||
!context.inst_blocks().Get(function_info.param_patterns_id).empty() ||
(return_type_id.is_valid() &&
return_type_id !=
context.GetBuiltinType(SemIR::BuiltinInstKind::IntType) &&
return_type_id != context.GetInt32Type() &&
return_type_id != context.GetTupleType({}))) {
CARBON_DIAGNOSTIC(InvalidMainRunSignature, Error,
"invalid signature for `Main.Run` function; expected "
Expand Down
5 changes: 2 additions & 3 deletions toolchain/check/handle_if_expr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,8 @@ static auto DecayIntLiteralToSizedInt(Context& context, Parse::NodeId node_id,
-> SemIR::InstId {
if (context.types().GetInstId(context.insts().Get(operand_id).type_id()) ==
SemIR::InstId::BuiltinIntLiteralType) {
operand_id = ConvertToValueOfType(
context, node_id, operand_id,
context.GetBuiltinType(SemIR::BuiltinInstKind::IntType));
operand_id = ConvertToValueOfType(context, node_id, operand_id,
context.GetInt32Type());
}
return operand_id;
}
Expand Down
3 changes: 1 addition & 2 deletions toolchain/check/handle_index.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,7 @@ auto HandleParseNode(Context& context, Parse::IndexExprId node_id) -> bool {
case CARBON_KIND(SemIR::ArrayType array_type): {
auto index_loc_id = context.insts().GetLocId(index_inst_id);
auto cast_index_id = ConvertToValueOfType(
context, index_loc_id, index_inst_id,
context.GetBuiltinType(SemIR::BuiltinInstKind::IntType));
context, index_loc_id, index_inst_id, context.GetInt32Type());
auto array_cat =
SemIR::GetExprCategory(context.sem_ir(), operand_inst_id);
if (array_cat == SemIR::ExprCategory::Value) {
Expand Down
9 changes: 0 additions & 9 deletions toolchain/check/handle_literal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ auto HandleParseNode(Context& context, Parse::BoolLiteralTrueId node_id)
// integer value, which is assumed to be unsigned.
static auto MakeIntLiteral(Context& context, Parse::NodeId node_id,
IntId int_id) -> SemIR::InstId {
// We rely on the lexer having normalized the `int_id` to a canonical width.
return context.AddInst<SemIR::IntValue>(
node_id, {.type_id = context.GetBuiltinType(
SemIR::BuiltinInstKind::IntLiteralType),
Expand Down Expand Up @@ -134,14 +133,6 @@ auto HandleParseNode(Context& context, Parse::IntTypeLiteralId node_id)
-> bool {
auto tok_id = context.parse_tree().node_token(node_id);
auto size_id = context.tokens().GetTypeLiteralSize(tok_id);
// Special case: `i32` has a custom builtin for now.
// TODO: Remove this special case.
if (context.ints().Get(size_id) == 32) {
auto fn_inst_id = context.LookupNameInCore(node_id, "Int32");
auto type_inst_id = PerformCall(context, node_id, fn_inst_id, {});
context.node_stack().Push(node_id, type_inst_id);
return true;
}
return HandleIntOrUnsignedIntTypeLiteral(context, node_id,
SemIR::IntKind::Signed, size_id);
}
Expand Down
11 changes: 7 additions & 4 deletions toolchain/check/testdata/alias/fail_builtins.carbon
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,17 @@ alias b = bool;
// CHECK:STDOUT: --- fail_builtins.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template]
// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template]
// CHECK:STDOUT: %.1: 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, %.1 [template]
// CHECK:STDOUT: %Bool.type: type = fn_type @Bool [template]
// CHECK:STDOUT: %Bool: %Bool.type = struct_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
// CHECK:STDOUT: .Int32 = %import_ref.1
// CHECK:STDOUT: .Int = %import_ref.1
// CHECK:STDOUT: .Bool = %import_ref.2
// CHECK:STDOUT: import Core//prelude
// CHECK:STDOUT: import Core//prelude/...
Expand All @@ -44,7 +46,8 @@ alias b = bool;
// CHECK:STDOUT: .b = %b
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core.import = import Core
// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc15: Core.IntLiteral = int_value 32 [template = constants.%.1]
// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc15) [template = constants.%i32]
// CHECK:STDOUT: %a: <error> = bind_alias a, <error> [template = <error>]
// CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool]
// CHECK:STDOUT: %b: <error> = bind_alias b, <error> [template = <error>]
Expand Down
80 changes: 44 additions & 36 deletions toolchain/check/testdata/array/array_in_place.carbon
Original file line number Diff line number Diff line change
Expand Up @@ -17,24 +17,26 @@ fn G() {
// CHECK:STDOUT: --- array_in_place.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template]
// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template]
// CHECK:STDOUT: %.1: 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, %.1 [template]
// CHECK:STDOUT: %tuple.type.1: type = tuple_type (type, type, type) [template]
// CHECK:STDOUT: %tuple.type.2: type = tuple_type (i32, i32, i32) [template]
// CHECK:STDOUT: %tuple.type.2: type = tuple_type (%i32, %i32, %i32) [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]
// CHECK:STDOUT: %G: %G.type = struct_value () [template]
// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 2 [template]
// CHECK:STDOUT: %.2: type = array_type %.1, %tuple.type.2 [template]
// CHECK:STDOUT: %.2: Core.IntLiteral = int_value 2 [template]
// CHECK:STDOUT: %.3: type = array_type %.2, %tuple.type.2 [template]
// CHECK:STDOUT: %tuple.type.3: type = tuple_type (%tuple.type.2, %tuple.type.2) [template]
// CHECK:STDOUT: %.5: i32 = int_value 0 [template]
// CHECK:STDOUT: %.6: i32 = int_value 1 [template]
// CHECK:STDOUT: %.6: Core.IntLiteral = int_value 0 [template]
// CHECK:STDOUT: %.7: Core.IntLiteral = int_value 1 [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
// CHECK:STDOUT: .Int32 = %import_ref
// CHECK:STDOUT: .Int = %import_ref
// CHECK:STDOUT: import Core//prelude
// CHECK:STDOUT: import Core//prelude/...
// CHECK:STDOUT: }
Expand All @@ -51,16 +53,19 @@ fn G() {
// CHECK:STDOUT: %return.patt: %tuple.type.2 = return_slot_pattern
// CHECK:STDOUT: %return.param_patt: %tuple.type.2 = out_param_pattern %return.patt, runtime_param0
// CHECK:STDOUT: } {
// CHECK:STDOUT: %int.make_type_32.loc11_12: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %int.make_type_32.loc11_17: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %int.make_type_32.loc11_22: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc11_25.1: %tuple.type.1 = tuple_literal (%int.make_type_32.loc11_12, %int.make_type_32.loc11_17, %int.make_type_32.loc11_22)
// CHECK:STDOUT: %.loc11_25.2: type = value_of_initializer %int.make_type_32.loc11_12 [template = i32]
// CHECK:STDOUT: %.loc11_25.3: type = converted %int.make_type_32.loc11_12, %.loc11_25.2 [template = i32]
// CHECK:STDOUT: %.loc11_25.4: type = value_of_initializer %int.make_type_32.loc11_17 [template = i32]
// CHECK:STDOUT: %.loc11_25.5: type = converted %int.make_type_32.loc11_17, %.loc11_25.4 [template = i32]
// CHECK:STDOUT: %.loc11_25.6: type = value_of_initializer %int.make_type_32.loc11_22 [template = i32]
// CHECK:STDOUT: %.loc11_25.7: type = converted %int.make_type_32.loc11_22, %.loc11_25.6 [template = i32]
// CHECK:STDOUT: %.loc11_12: Core.IntLiteral = int_value 32 [template = constants.%.1]
// CHECK:STDOUT: %int.make_type_signed.loc11_12: init type = call constants.%Int(%.loc11_12) [template = constants.%i32]
// CHECK:STDOUT: %.loc11_17: Core.IntLiteral = int_value 32 [template = constants.%.1]
// CHECK:STDOUT: %int.make_type_signed.loc11_17: init type = call constants.%Int(%.loc11_17) [template = constants.%i32]
// CHECK:STDOUT: %.loc11_22: Core.IntLiteral = int_value 32 [template = constants.%.1]
// CHECK:STDOUT: %int.make_type_signed.loc11_22: init type = call constants.%Int(%.loc11_22) [template = constants.%i32]
// CHECK:STDOUT: %.loc11_25.1: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc11_12, %int.make_type_signed.loc11_17, %int.make_type_signed.loc11_22)
// CHECK:STDOUT: %.loc11_25.2: type = value_of_initializer %int.make_type_signed.loc11_12 [template = constants.%i32]
// CHECK:STDOUT: %.loc11_25.3: type = converted %int.make_type_signed.loc11_12, %.loc11_25.2 [template = constants.%i32]
// CHECK:STDOUT: %.loc11_25.4: type = value_of_initializer %int.make_type_signed.loc11_17 [template = constants.%i32]
// CHECK:STDOUT: %.loc11_25.5: type = converted %int.make_type_signed.loc11_17, %.loc11_25.4 [template = constants.%i32]
// CHECK:STDOUT: %.loc11_25.6: type = value_of_initializer %int.make_type_signed.loc11_22 [template = constants.%i32]
// CHECK:STDOUT: %.loc11_25.7: type = converted %int.make_type_signed.loc11_22, %.loc11_25.6 [template = constants.%i32]
// CHECK:STDOUT: %.loc11_25.8: type = converted %.loc11_25.1, constants.%tuple.type.2 [template = constants.%tuple.type.2]
// CHECK:STDOUT: %return.param: ref %tuple.type.2 = out_param runtime_param0
// CHECK:STDOUT: %return: ref %tuple.type.2 = return_slot %return.param
Expand All @@ -72,36 +77,39 @@ fn G() {
// CHECK:STDOUT:
// CHECK:STDOUT: fn @G() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %int.make_type_32.loc14_12: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %int.make_type_32.loc14_17: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %int.make_type_32.loc14_22: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc14_25.1: %tuple.type.1 = tuple_literal (%int.make_type_32.loc14_12, %int.make_type_32.loc14_17, %int.make_type_32.loc14_22)
// CHECK:STDOUT: %.loc14_28: Core.IntLiteral = int_value 2 [template = constants.%.1]
// CHECK:STDOUT: %.loc14_25.2: type = value_of_initializer %int.make_type_32.loc14_12 [template = i32]
// CHECK:STDOUT: %.loc14_25.3: type = converted %int.make_type_32.loc14_12, %.loc14_25.2 [template = i32]
// CHECK:STDOUT: %.loc14_25.4: type = value_of_initializer %int.make_type_32.loc14_17 [template = i32]
// CHECK:STDOUT: %.loc14_25.5: type = converted %int.make_type_32.loc14_17, %.loc14_25.4 [template = i32]
// CHECK:STDOUT: %.loc14_25.6: type = value_of_initializer %int.make_type_32.loc14_22 [template = i32]
// CHECK:STDOUT: %.loc14_25.7: type = converted %int.make_type_32.loc14_22, %.loc14_25.6 [template = i32]
// CHECK:STDOUT: %.loc14_12: Core.IntLiteral = int_value 32 [template = constants.%.1]
// CHECK:STDOUT: %int.make_type_signed.loc14_12: init type = call constants.%Int(%.loc14_12) [template = constants.%i32]
// CHECK:STDOUT: %.loc14_17: Core.IntLiteral = int_value 32 [template = constants.%.1]
// CHECK:STDOUT: %int.make_type_signed.loc14_17: init type = call constants.%Int(%.loc14_17) [template = constants.%i32]
// CHECK:STDOUT: %.loc14_22: Core.IntLiteral = int_value 32 [template = constants.%.1]
// CHECK:STDOUT: %int.make_type_signed.loc14_22: init type = call constants.%Int(%.loc14_22) [template = constants.%i32]
// CHECK:STDOUT: %.loc14_25.1: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc14_12, %int.make_type_signed.loc14_17, %int.make_type_signed.loc14_22)
// CHECK:STDOUT: %.loc14_28: Core.IntLiteral = int_value 2 [template = constants.%.2]
// CHECK:STDOUT: %.loc14_25.2: type = value_of_initializer %int.make_type_signed.loc14_12 [template = constants.%i32]
// CHECK:STDOUT: %.loc14_25.3: type = converted %int.make_type_signed.loc14_12, %.loc14_25.2 [template = constants.%i32]
// CHECK:STDOUT: %.loc14_25.4: type = value_of_initializer %int.make_type_signed.loc14_17 [template = constants.%i32]
// CHECK:STDOUT: %.loc14_25.5: type = converted %int.make_type_signed.loc14_17, %.loc14_25.4 [template = constants.%i32]
// CHECK:STDOUT: %.loc14_25.6: type = value_of_initializer %int.make_type_signed.loc14_22 [template = constants.%i32]
// CHECK:STDOUT: %.loc14_25.7: type = converted %int.make_type_signed.loc14_22, %.loc14_25.6 [template = constants.%i32]
// CHECK:STDOUT: %.loc14_25.8: type = converted %.loc14_25.1, constants.%tuple.type.2 [template = constants.%tuple.type.2]
// CHECK:STDOUT: %.loc14_29: type = array_type %.loc14_28, %tuple.type.2 [template = constants.%.2]
// CHECK:STDOUT: %v.var: ref %.2 = var v
// CHECK:STDOUT: %v: ref %.2 = bind_name v, %v.var
// CHECK:STDOUT: %.loc14_29: type = array_type %.loc14_28, %tuple.type.2 [template = constants.%.3]
// CHECK:STDOUT: %v.var: ref %.3 = var v
// CHECK:STDOUT: %v: ref %.3 = bind_name v, %v.var
// CHECK:STDOUT: %F.ref.loc14_34: %F.type = name_ref F, file.%F.decl [template = constants.%F]
// CHECK:STDOUT: %.loc14_42.3: ref %tuple.type.2 = splice_block %.loc14_42.2 {
// CHECK:STDOUT: %.loc14_42.1: i32 = int_value 0 [template = constants.%.5]
// CHECK:STDOUT: %.loc14_42.1: Core.IntLiteral = int_value 0 [template = constants.%.6]
// CHECK:STDOUT: %.loc14_42.2: ref %tuple.type.2 = array_index %v.var, %.loc14_42.1
// CHECK:STDOUT: }
// CHECK:STDOUT: %F.call.loc14_35: init %tuple.type.2 = call %F.ref.loc14_34() to %.loc14_42.3
// CHECK:STDOUT: %F.ref.loc14_39: %F.type = name_ref F, file.%F.decl [template = constants.%F]
// CHECK:STDOUT: %.loc14_42.6: ref %tuple.type.2 = splice_block %.loc14_42.5 {
// CHECK:STDOUT: %.loc14_42.4: i32 = int_value 1 [template = constants.%.6]
// CHECK:STDOUT: %.loc14_42.4: Core.IntLiteral = int_value 1 [template = constants.%.7]
// CHECK:STDOUT: %.loc14_42.5: ref %tuple.type.2 = array_index %v.var, %.loc14_42.4
// CHECK:STDOUT: }
// CHECK:STDOUT: %F.call.loc14_40: init %tuple.type.2 = call %F.ref.loc14_39() to %.loc14_42.6
// CHECK:STDOUT: %.loc14_42.7: %tuple.type.3 = tuple_literal (%F.call.loc14_35, %F.call.loc14_40)
// CHECK:STDOUT: %.loc14_42.8: init %.2 = array_init (%F.call.loc14_35, %F.call.loc14_40) to %v.var
// CHECK:STDOUT: %.loc14_43: init %.2 = converted %.loc14_42.7, %.loc14_42.8
// CHECK:STDOUT: %.loc14_42.8: init %.3 = array_init (%F.call.loc14_35, %F.call.loc14_40) to %v.var
// CHECK:STDOUT: %.loc14_43: init %.3 = converted %.loc14_42.7, %.loc14_42.8
// CHECK:STDOUT: assign %v.var, %.loc14_43
// CHECK:STDOUT: return
// CHECK:STDOUT: }
Expand Down
Loading

0 comments on commit e2ae5f2

Please sign in to comment.