authorgravatar for jacobly@ziglang.orgJacob Young <jacobly@ziglang.org> 2026-06-26 01:52:10-04:00
committergravatar for jacobly@ziglang.orgJacob Young <jacobly@ziglang.org> 2026-07-27 14:35:12-04:00
logc6ab46cc3effecd18db8b8469de965eafd02e1fd
tree6f33a1b85d6e30eb8db45e0aed72f79ab8f17e6e
parent9e7f40db3a83242e12db853431cea0701446f5fb

llvm: `TypeRepr.by_value` -> `TypeRepr.as_value`

Otherwise, I constantly get it confused with `by_val` and `byval`.

2 files changed, 137 insertions(+), 137 deletions(-)

src/codegen/llvm.zig+20-20
......@@ -2848,7 +2848,7 @@ pub const Object = struct {
28482848 pub const TypeRepr = enum {
28492849 /// The representation of the type when it is being manipulated as a value in a function.
28502850 /// e.g. Zig `u5` -> LLVM `i5`
2851 by_value,
2851 as_value,
28522852 /// The representation of the type when it is stored in memory.
28532853 /// e.g. Zig `u5` -> LLVM `i8`
28542854 in_memory,
......@@ -2856,7 +2856,7 @@ pub const Object = struct {
28562856
28572857 pub fn errorIntType(o: *Object, repr: TypeRepr) Allocator.Error!Builder.Type {
28582858 return o.builder.intType(switch (repr) {
2859 .by_value => o.zcu.errorSetBits(),
2859 .as_value => o.zcu.errorSetBits(),
28602860 .in_memory => @intCast(Type.anyerror.abiSize(o.zcu) * 8),
28612861 });
28622862 }
......@@ -2866,7 +2866,7 @@ pub const Object = struct {
28662866 const target = zcu.getTarget();
28672867 const ip = &zcu.intern_pool;
28682868
2869 if (repr == .by_value) {
2869 if (repr == .as_value) {
28702870 assert(!isByRef(t, zcu)); // by-ref types must only be manipulated in memory
28712871 }
28722872
......@@ -2886,7 +2886,7 @@ pub const Object = struct {
28862886 .u128_type,
28872887 .i128_type,
28882888 => |tag| switch (repr) {
2889 .by_value => @field(Builder.Type, "i" ++ @tagName(tag)[1 .. @tagName(tag).len - "_type".len]),
2889 .as_value => @field(Builder.Type, "i" ++ @tagName(tag)[1 .. @tagName(tag).len - "_type".len]),
28902890 .in_memory => try o.builder.intType(@intCast(t.abiSize(zcu) * 8)),
28912891 },
28922892 .usize_type, .isize_type => try o.builder.intType(target.ptrBitWidth()),
......@@ -2973,7 +2973,7 @@ pub const Object = struct {
29732973 => unreachable,
29742974 else => switch (ip.indexToKey(t.toIntern())) {
29752975 .int_type => |int_type| switch (repr) {
2976 .by_value => try o.builder.intType(int_type.bits),
2976 .as_value => try o.builder.intType(int_type.bits),
29772977 .in_memory => try o.builder.intType(@intCast(t.abiSize(zcu) * 8)),
29782978 },
29792979 .ptr_type => |ptr_type| type: {
......@@ -2995,7 +2995,7 @@ pub const Object = struct {
29952995 .vector_type => |vector_type| o.builder.vectorType(
29962996 .normal,
29972997 vector_type.len,
2998 try o.lowerType(.fromInterned(vector_type.child), .by_value),
2998 try o.lowerType(.fromInterned(vector_type.child), .as_value),
29992999 ),
30003000 .opt_type => |child_ty| {
30013001 // Must stay in sync with `opt_payload` logic in `lowerPtr`.
......@@ -3310,7 +3310,7 @@ pub const Object = struct {
33103310 .no_bits => continue,
33113311 .byval => {
33123312 const param_ty = Type.fromInterned(fn_info.param_types.get(ip)[it.zig_index - 1]);
3313 try llvm_params.append(o.gpa, try o.lowerType(param_ty, if (isByRef(param_ty, zcu)) .in_memory else .by_value));
3313 try llvm_params.append(o.gpa, try o.lowerType(param_ty, if (isByRef(param_ty, zcu)) .in_memory else .as_value));
33143314 },
33153315 .byref, .byref_mut => {
33163316 try llvm_params.append(o.gpa, .ptr);
......@@ -3325,7 +3325,7 @@ pub const Object = struct {
33253325 const param_ty = Type.fromInterned(fn_info.param_types.get(ip)[it.zig_index - 1]);
33263326 try llvm_params.appendSlice(o.gpa, &.{
33273327 try o.builder.ptrType(toLlvmAddressSpace(param_ty.ptrAddressSpace(zcu), target)),
3328 try o.lowerType(.usize, .by_value),
3328 try o.lowerType(.usize, .as_value),
33293329 });
33303330 },
33313331 .multiple_llvm_types => {
......@@ -3347,7 +3347,7 @@ pub const Object = struct {
33473347
33483348 const llvm_ret_ty: Builder.Type = switch (ret_strat) {
33493349 .void, .sret => .void,
3350 .by_val => try o.lowerType(.fromInterned(fn_info.return_type), .by_value),
3350 .by_val => try o.lowerType(.fromInterned(fn_info.return_type), .as_value),
33513351 .mem_cast => |llvm_ret_ty| llvm_ret_ty,
33523352 };
33533353 const llvm_fn_kind: Builder.Type.Function.Kind = switch (fn_info.is_var_args) {
......@@ -3604,7 +3604,7 @@ pub const Object = struct {
36043604 result_val.* = try o.builder.intConst(.i8, byte);
36053605 },
36063606 .elems => |elems| for (vals, elems) |*result_val, elem| {
3607 result_val.* = try o.lowerValue(elem, .by_value);
3607 result_val.* = try o.lowerValue(elem, .as_value);
36083608 },
36093609 .repeated_elem => unreachable,
36103610 }
......@@ -3612,7 +3612,7 @@ pub const Object = struct {
36123612 },
36133613 .repeated_elem => |elem| return o.builder.splatConst(
36143614 vector_ty,
3615 try o.lowerValue(elem, .by_value),
3615 try o.lowerValue(elem, .as_value),
36163616 ),
36173617 }
36183618 },
......@@ -3869,8 +3869,8 @@ pub const Object = struct {
38693869 },
38703870 .int => try o.builder.castConst(
38713871 .inttoptr,
3872 try o.builder.intConst(try o.lowerType(.usize, .by_value), offset),
3873 try o.lowerType(.fromInterned(ptr.ty), .by_value),
3872 try o.builder.intConst(try o.lowerType(.usize, .as_value), offset),
3873 try o.lowerType(.fromInterned(ptr.ty), .as_value),
38743874 ),
38753875 .eu_payload => |eu_ptr| try o.lowerPtr(
38763876 eu_ptr,
......@@ -3917,7 +3917,7 @@ pub const Object = struct {
39173917 @"addrspace": std.lang.AddressSpace,
39183918 ) Allocator.Error!Builder.Constant {
39193919 const addr: u64 = @"align".toByteUnits().?;
3920 const llvm_usize = try o.lowerType(.usize, .by_value);
3920 const llvm_usize = try o.lowerType(.usize, .as_value);
39213921 const llvm_addr = try o.builder.intConst(llvm_usize, addr);
39223922 const llvm_ptr_ty = try o.builder.ptrType(toLlvmAddressSpace(@"addrspace", o.zcu.getTarget()));
39233923 return o.builder.castConst(.inttoptr, llvm_addr, llvm_ptr_ty);
......@@ -4132,9 +4132,9 @@ pub const Object = struct {
41324132 const ip = &zcu.intern_pool;
41334133 const loaded_enum = ip.loadEnumType(enum_ty.toIntern());
41344134
4135 const llvm_usize_ty = try o.lowerType(.usize, .by_value);
4136 const llvm_ret_ty = try o.lowerType(.slice_const_u8_sentinel_0, .by_value);
4137 const llvm_int_ty = try o.lowerType(.fromInterned(loaded_enum.int_tag_type), .by_value);
4135 const llvm_usize_ty = try o.lowerType(.usize, .as_value);
4136 const llvm_ret_ty = try o.lowerType(.slice_const_u8_sentinel_0, .as_value);
4137 const llvm_int_ty = try o.lowerType(.fromInterned(loaded_enum.int_tag_type), .as_value);
41384138
41394139 function_index.ptrConst(&o.builder).global.ptr(&o.builder).type =
41404140 try o.builder.fnType(llvm_ret_ty, &.{llvm_int_ty}, .normal);
......@@ -4183,7 +4183,7 @@ pub const Object = struct {
41834183 const return_block = try wip.block(1, "Name");
41844184 const llvm_tag_val = switch (loaded_enum.field_values.getOrNone(ip, field_index)) {
41854185 .none => try o.builder.intConst(llvm_int_ty, field_index), // auto-numbered
4186 else => |tag_val_ip| try o.lowerValue(tag_val_ip, .by_value),
4186 else => |tag_val_ip| try o.lowerValue(tag_val_ip, .as_value),
41874187 };
41884188 try wip_switch.addCase(llvm_tag_val, return_block, &wip);
41894189
......@@ -4229,7 +4229,7 @@ pub const Object = struct {
42294229 const ip = &zcu.intern_pool;
42304230 const loaded_enum = ip.loadEnumType(enum_ty.toIntern());
42314231
4232 const llvm_int_ty = try o.lowerType(.fromInterned(loaded_enum.int_tag_type), .by_value);
4232 const llvm_int_ty = try o.lowerType(.fromInterned(loaded_enum.int_tag_type), .as_value);
42334233 function_index.ptrConst(&o.builder).global.ptr(&o.builder).type =
42344234 try o.builder.fnType(.i1, &.{llvm_int_ty}, .normal);
42354235
......@@ -4256,7 +4256,7 @@ pub const Object = struct {
42564256
42574257 if (loaded_enum.field_values.len > 0) {
42584258 for (loaded_enum.field_values.get(ip)) |tag_val_ip| {
4259 const llvm_tag_val = try o.lowerValue(tag_val_ip, .by_value);
4259 const llvm_tag_val = try o.lowerValue(tag_val_ip, .as_value);
42604260 try wip_switch.addCase(llvm_tag_val, named_block, &wip);
42614261 }
42624262 } else {
src/codegen/llvm/FuncGen.zig+117-117
......@@ -164,7 +164,7 @@ fn resolveValue(self: *FuncGen, val: Value) Allocator.Error!Builder.Constant {
164164 const zcu = o.zcu;
165165 const ty = val.typeOf(zcu);
166166 if (!isByRef(ty, zcu)) {
167 return o.lowerValue(val.toIntern(), .by_value);
167 return o.lowerValue(val.toIntern(), .as_value);
168168 } else {
169169 // We need a pointer to a global constant, i.e. a UAV.
170170 return o.lowerUavRef(
......@@ -264,7 +264,7 @@ pub fn genMainBody(fg: *FuncGen) TodoError!void {
264264 const param_ty: Type = .fromInterned(param_types[it.zig_index - 1]);
265265 assert(!isByRef(param_ty, zcu));
266266 const slice_val = try fg.wip.buildAggregate(
267 try o.lowerType(param_ty, .by_value),
267 try o.lowerType(param_ty, .as_value),
268268 &.{ fg.wip.arg(it.llvm_index - 2), fg.wip.arg(it.llvm_index - 1) },
269269 "",
270270 );
......@@ -998,7 +998,7 @@ fn airCall(self: *FuncGen, inst: Air.Inst.Index, modifier: std.lang.CallModifier
998998 },
999999 cc_info.llvm_cc,
10001000 try attributes.finish(&o.builder),
1001 try o.lowerType(zig_fn_ty, .by_value),
1001 try o.lowerType(zig_fn_ty, .as_value),
10021002 llvm_fn,
10031003 llvm_args.items,
10041004 "",
......@@ -1038,7 +1038,7 @@ fn buildSimplePanic(fg: *FuncGen, panic_id: Zcu.SimplePanicId) Allocator.Error!v
10381038 const target = zcu.getTarget();
10391039 const panic_func = zcu.funcInfo(zcu.std_lang_decl_values.get(panic_id.toStdLangDecl()));
10401040 const fn_info = zcu.typeToFunc(.fromInterned(panic_func.ty)).?;
1041 const llvm_panic_fn_ty = try o.lowerType(.fromInterned(panic_func.ty), .by_value);
1041 const llvm_panic_fn_ty = try o.lowerType(.fromInterned(panic_func.ty), .as_value);
10421042
10431043 const llvm_panic_fn_ref = try o.lowerNavRef(panic_func.owner_nav);
10441044
......@@ -1076,7 +1076,7 @@ fn airRet(self: *FuncGen, inst: Air.Inst.Index, safety: bool) Allocator.Error!vo
10761076 .none => try self.buildZigAlloca(ret_ty, .none),
10771077 else => |rp| rp,
10781078 };
1079 const len = try o.builder.intValue(try o.lowerType(.usize, .by_value), ret_ty.abiSize(zcu));
1079 const len = try o.builder.intValue(try o.lowerType(.usize, .as_value), ret_ty.abiSize(zcu));
10801080 _ = try self.wip.callMemSet(
10811081 rp,
10821082 ret_ty_align.toLlvm(),
......@@ -1165,7 +1165,7 @@ fn airCVaArg(self: *FuncGen, inst: Air.Inst.Index) Allocator.Error!Builder.Value
11651165 const ty_op = self.air.instructions.items(.data)[@backingInt(inst)].ty_op;
11661166 const list = try self.resolveInst(ty_op.operand);
11671167 const arg_ty = ty_op.ty.toType();
1168 const llvm_arg_ty = try self.object.lowerType(arg_ty, .by_value);
1168 const llvm_arg_ty = try self.object.lowerType(arg_ty, .as_value);
11691169
11701170 return self.wip.vaArg(list, llvm_arg_ty, "");
11711171}
......@@ -1378,7 +1378,7 @@ fn lowerBlock(
13781378 if (have_block_result) {
13791379 const llvm_ty: Builder.Type = switch (isByRef(inst_ty, zcu)) {
13801380 true => .ptr,
1381 false => try o.lowerType(inst_ty, .by_value),
1381 false => try o.lowerType(inst_ty, .as_value),
13821382 };
13831383 parent_bb.ptr(&self.wip).incoming = @intCast(breaks.list.len);
13841384 const phi = try self.wip.phi(llvm_ty, "");
......@@ -1485,7 +1485,7 @@ fn lowerSwitchDispatch(
14851485 const table_index = try self.wip.conv(
14861486 .unsigned,
14871487 try self.wip.bin(.@"sub nuw", cond, jmp_table.min.toValue(), ""),
1488 try o.lowerType(.usize, .by_value),
1488 try o.lowerType(.usize, .as_value),
14891489 "",
14901490 );
14911491 const target_ptr_ptr = try self.ptraddScaled(
......@@ -1510,7 +1510,7 @@ fn lowerSwitchDispatch(
15101510 // The switch prongs will correspond to our scalar cases. Ranges will
15111511 // be handled by conditional branches in the `else` prong.
15121512
1513 const llvm_usize = try o.lowerType(.usize, .by_value);
1513 const llvm_usize = try o.lowerType(.usize, .as_value);
15141514 const cond_int = if (cond_ty.zigTypeTag(zcu) == .pointer)
15151515 try self.wip.cast(.ptrtoint, cond, llvm_usize, "")
15161516 else
......@@ -1725,7 +1725,7 @@ fn lowerTry(
17251725 if (err_union_ty.isVolatilePtr(zcu)) .@"volatile" else .normal,
17261726 );
17271727 };
1728 const zero = try o.builder.intValue(try o.errorIntType(.by_value), 0);
1728 const zero = try o.builder.intValue(try o.errorIntType(.as_value), 0);
17291729 const is_err = try fg.wip.icmp(.ne, loaded, zero, "");
17301730
17311731 const return_block = try fg.wip.block(1, "TryRet");
......@@ -1862,8 +1862,8 @@ fn airSwitchBr(self: *FuncGen, inst: Air.Inst.Index, is_dispatch_loop: bool) Tod
18621862 const table_includes_else = item_count != table_len;
18631863
18641864 break :jmp_table .{
1865 .min = try o.lowerValue(min.toIntern(), .by_value),
1866 .max = try o.lowerValue(max.toIntern(), .by_value),
1865 .min = try o.lowerValue(min.toIntern(), .as_value),
1866 .max = try o.lowerValue(max.toIntern(), .as_value),
18671867 .in_bounds_hint = if (table_includes_else) .none else switch (switch_br.getElseHint()) {
18681868 .none, .cold => .none,
18691869 .unpredictable => .unpredictable,
......@@ -2021,9 +2021,9 @@ fn airArrayToSlice(self: *FuncGen, inst: Air.Inst.Index) Allocator.Error!Builder
20212021 const ty_op = self.air.instructions.items(.data)[@backingInt(inst)].ty_op;
20222022 const operand_ty = self.typeOf(ty_op.operand);
20232023 const array_ty = operand_ty.childType(zcu);
2024 const llvm_usize = try o.lowerType(.usize, .by_value);
2024 const llvm_usize = try o.lowerType(.usize, .as_value);
20252025 const len = try o.builder.intValue(llvm_usize, array_ty.arrayLen(zcu));
2026 const slice_llvm_ty = try o.lowerType(self.typeOfIndex(inst), .by_value);
2026 const slice_llvm_ty = try o.lowerType(self.typeOfIndex(inst), .as_value);
20272027 const operand = try self.resolveInst(ty_op.operand);
20282028 return self.wip.buildAggregate(slice_llvm_ty, &.{ operand, len }, "");
20292029}
......@@ -2040,7 +2040,7 @@ fn airFloatFromInt(self: *FuncGen, inst: Air.Inst.Index) TodoError!Builder.Value
20402040
20412041 const dest_ty = self.typeOfIndex(inst);
20422042 const dest_scalar_ty = dest_ty.scalarType(zcu);
2043 const dest_llvm_ty = try o.lowerType(dest_ty, .by_value);
2043 const dest_llvm_ty = try o.lowerType(dest_ty, .as_value);
20442044 const target = zcu.getTarget();
20452045
20462046 if (intrinsicsAllowed(dest_scalar_ty, target)) return self.wip.conv(
......@@ -2108,7 +2108,7 @@ fn airIntFromFloat(
21082108
21092109 const dest_ty = self.typeOfIndex(inst);
21102110 const dest_scalar_ty = dest_ty.scalarType(zcu);
2111 const dest_llvm_ty = try o.lowerType(dest_ty, .by_value);
2111 const dest_llvm_ty = try o.lowerType(dest_ty, .as_value);
21122112
21132113 if (intrinsicsAllowed(operand_scalar_ty, target)) {
21142114 // TODO set fast math flag
......@@ -2142,7 +2142,7 @@ fn airIntFromFloat(
21422142 compiler_rt_dest_abbrev,
21432143 });
21442144
2145 const operand_llvm_ty = try o.lowerType(operand_ty, .by_value);
2145 const operand_llvm_ty = try o.lowerType(operand_ty, .as_value);
21462146 const libc_fn = try o.getLibcFunction(fn_name, &.{operand_llvm_ty}, libc_ret_ty);
21472147 var result = try self.wip.call(
21482148 .normal,
......@@ -2167,7 +2167,7 @@ fn sliceOrArrayPtr(fg: *FuncGen, ptr: Builder.Value, ty: Type) Allocator.Error!B
21672167fn sliceOrArrayLenInBytes(fg: *FuncGen, ptr: Builder.Value, ty: Type) Allocator.Error!Builder.Value {
21682168 const o = fg.object;
21692169 const zcu = o.zcu;
2170 const llvm_usize = try o.lowerType(.usize, .by_value);
2170 const llvm_usize = try o.lowerType(.usize, .as_value);
21712171 switch (ty.ptrSize(zcu)) {
21722172 .slice => {
21732173 const len = try fg.wip.extractValue(ptr, &.{1}, "");
......@@ -2365,7 +2365,7 @@ fn airAggFieldVal(self: *FuncGen, inst: Air.Inst.Index) Allocator.Error!Builder.
23652365 },
23662366 .float => {
23672367 // bitcast int->float
2368 return self.wip.cast(.bitcast, field_int_val, try o.lowerType(field_ty, .by_value), "");
2368 return self.wip.cast(.bitcast, field_int_val, try o.lowerType(field_ty, .as_value), "");
23692369 },
23702370 }
23712371 }
......@@ -2395,8 +2395,8 @@ fn airFieldParentPtr(self: *FuncGen, inst: Air.Inst.Index) Allocator.Error!Build
23952395 const field_offset = parent_ty.structFieldOffset(extra.field_index, zcu);
23962396 if (field_offset == 0) return field_ptr;
23972397
2398 const res_ty = try o.lowerType(ty_pl.ty.toType(), .by_value);
2399 const llvm_usize = try o.lowerType(.usize, .by_value);
2398 const res_ty = try o.lowerType(ty_pl.ty.toType(), .as_value);
2399 const llvm_usize = try o.lowerType(.usize, .as_value);
24002400
24012401 const field_ptr_int = try self.wip.cast(.ptrtoint, field_ptr, llvm_usize, "");
24022402 const base_ptr_int = try self.wip.bin(
......@@ -2612,7 +2612,7 @@ fn airAssembly(self: *FuncGen, inst: Air.Inst.Index) TodoError!Builder.Value {
26122612 const output_inst = try self.resolveInst(output.operand);
26132613 const output_ty = self.typeOf(output.operand);
26142614 assert(output_ty.zigTypeTag(zcu) == .pointer);
2615 const elem_llvm_ty = try o.lowerType(output_ty.childType(zcu), .by_value);
2615 const elem_llvm_ty = try o.lowerType(output_ty.childType(zcu), .as_value);
26162616
26172617 switch (constraint[0]) {
26182618 '=' => {},
......@@ -2650,7 +2650,7 @@ fn airAssembly(self: *FuncGen, inst: Air.Inst.Index) TodoError!Builder.Value {
26502650 llvm_ret_indirect[output.index] = false;
26512651
26522652 const ret_ty = self.typeOfIndex(inst);
2653 llvm_ret_types[llvm_ret_i] = try o.lowerType(ret_ty, .by_value);
2653 llvm_ret_types[llvm_ret_i] = try o.lowerType(ret_ty, .as_value);
26542654 llvm_ret_i += 1;
26552655 }
26562656
......@@ -2689,7 +2689,7 @@ fn airAssembly(self: *FuncGen, inst: Air.Inst.Index) TodoError!Builder.Value {
26892689 llvm_param_types[llvm_param_i] = arg_llvm_value.typeOfWip(&self.wip);
26902690 } else {
26912691 const alignment = arg_ty.abiAlignment(zcu).toLlvm();
2692 const arg_llvm_ty = try o.lowerType(arg_ty, .by_value);
2692 const arg_llvm_ty = try o.lowerType(arg_ty, .as_value);
26932693 const load_inst = try self.wip.load(.normal, arg_llvm_ty, arg_llvm_value, alignment, "");
26942694 llvm_param_values[llvm_param_i] = load_inst;
26952695 llvm_param_types[llvm_param_i] = arg_llvm_ty;
......@@ -2729,7 +2729,7 @@ fn airAssembly(self: *FuncGen, inst: Air.Inst.Index) TodoError!Builder.Value {
27292729 llvm_param_attrs[llvm_param_i] = if (constraint[0] == '*') blk: {
27302730 if (!is_by_ref) self.maybeMarkAllowZeroAccess(arg_ty.ptrInfo(zcu));
27312731
2732 break :blk try o.lowerType(if (is_by_ref) arg_ty else arg_ty.childType(zcu), .by_value);
2732 break :blk try o.lowerType(if (is_by_ref) arg_ty else arg_ty.childType(zcu), .as_value);
27332733 } else .none;
27342734
27352735 llvm_param_i += 1;
......@@ -2743,7 +2743,7 @@ fn airAssembly(self: *FuncGen, inst: Air.Inst.Index) TodoError!Builder.Value {
27432743 if (constraint[0] != '+') continue;
27442744
27452745 const rw_ty = self.typeOf(output.operand);
2746 const llvm_elem_ty = try o.lowerType(rw_ty.childType(zcu), .by_value);
2746 const llvm_elem_ty = try o.lowerType(rw_ty.childType(zcu), .as_value);
27472747 if (llvm_ret_indirect[output.index]) {
27482748 llvm_param_values[llvm_param_i] = llvm_rw_vals[output.index];
27492749 llvm_param_types[llvm_param_i] = llvm_rw_vals[output.index].typeOfWip(&self.wip);
......@@ -2957,7 +2957,7 @@ fn airIsNonNull(
29572957 ));
29582958 return self.wip.icmp(cond, slice_ptr, try o.builder.nullValue(ptr_ty), "");
29592959 }
2960 return self.wip.icmp(cond, loaded, try o.builder.zeroInitValue(try o.lowerType(optional_ty, .by_value)), "");
2960 return self.wip.icmp(cond, loaded, try o.builder.zeroInitValue(try o.lowerType(optional_ty, .as_value)), "");
29612961 }
29622962
29632963 comptime assert(optional_layout_version == 3);
......@@ -2986,7 +2986,7 @@ fn airIsErr(
29862986 const operand_ty = self.typeOf(un_op);
29872987 const err_union_ty = if (operand_is_ptr) operand_ty.childType(zcu) else operand_ty;
29882988 const payload_ty = err_union_ty.errorUnionPayload(zcu);
2989 const zero_err = try o.builder.intValue(try o.errorIntType(.by_value), 0);
2989 const zero_err = try o.builder.intValue(try o.errorIntType(.as_value), 0);
29902990
29912991 const access_kind: Builder.MemoryAccessKind =
29922992 if (operand_is_ptr and operand_ty.isVolatilePtr(zcu)) .@"volatile" else .normal;
......@@ -3156,7 +3156,7 @@ fn airErrUnionPayloadPtrSet(self: *FuncGen, inst: Air.Inst.Index) Allocator.Erro
31563156 const err_union_ptr_align = err_union_ptr_ty.ptrAlignment(zcu);
31573157
31583158 const payload_ty = err_union_ty.errorUnionPayload(zcu);
3159 const non_error_val = try o.builder.intValue(try o.errorIntType(.by_value), 0);
3159 const non_error_val = try o.builder.intValue(try o.errorIntType(.as_value), 0);
31603160
31613161 const access_kind: Builder.MemoryAccessKind =
31623162 if (err_union_ptr_ty.isVolatilePtr(zcu)) .@"volatile" else .normal;
......@@ -3234,7 +3234,7 @@ fn airWrapErrUnionPayload(self: *FuncGen, inst: Air.Inst.Index) Allocator.Error!
32343234 const payload_ty = self.typeOf(ty_op.operand);
32353235 assert(payload_ty.hasRuntimeBits(zcu));
32363236 assert(isByRef(err_un_ty, zcu)); // error unions with runtime bits are always by-ref
3237 const ok_err_code = try o.builder.intValue(try o.errorIntType(.by_value), 0);
3237 const ok_err_code = try o.builder.intValue(try o.errorIntType(.as_value), 0);
32383238
32393239 const result_ptr = try self.buildZigAlloca(err_un_ty, .none);
32403240
......@@ -3273,7 +3273,7 @@ fn airWasmMemorySize(self: *FuncGen, inst: Air.Inst.Index) Allocator.Error!Build
32733273 const o = self.object;
32743274 const pl_op = self.air.instructions.items(.data)[@backingInt(inst)].pl_op;
32753275 const index = pl_op.payload;
3276 const llvm_usize = try o.lowerType(.usize, .by_value);
3276 const llvm_usize = try o.lowerType(.usize, .as_value);
32773277 return self.wip.callIntrinsic(.normal, .none, .@"wasm.memory.size", &.{llvm_usize}, &.{
32783278 try o.builder.intValue(.i32, index),
32793279 }, "");
......@@ -3283,7 +3283,7 @@ fn airWasmMemoryGrow(self: *FuncGen, inst: Air.Inst.Index) Allocator.Error!Build
32833283 const o = self.object;
32843284 const pl_op = self.air.instructions.items(.data)[@backingInt(inst)].pl_op;
32853285 const index = pl_op.payload;
3286 const llvm_isize = try o.lowerType(.isize, .by_value);
3286 const llvm_isize = try o.lowerType(.isize, .as_value);
32873287 return self.wip.callIntrinsic(.normal, .none, .@"wasm.memory.grow", &.{llvm_isize}, &.{
32883288 try o.builder.intValue(.i32, index), try self.resolveInst(pl_op.operand),
32893289 }, "");
......@@ -3310,7 +3310,7 @@ fn airMin(self: *FuncGen, inst: Air.Inst.Index) Allocator.Error!Builder.Value {
33103310 .normal,
33113311 .none,
33123312 if (scalar_ty.isSignedInt(zcu)) .smin else .umin,
3313 &.{try o.lowerType(inst_ty, .by_value)},
3313 &.{try o.lowerType(inst_ty, .as_value)},
33143314 &.{ lhs, rhs },
33153315 "",
33163316 );
......@@ -3330,7 +3330,7 @@ fn airMax(self: *FuncGen, inst: Air.Inst.Index) Allocator.Error!Builder.Value {
33303330 .normal,
33313331 .none,
33323332 if (scalar_ty.isSignedInt(zcu)) .smax else .umax,
3333 &.{try o.lowerType(inst_ty, .by_value)},
3333 &.{try o.lowerType(inst_ty, .as_value)},
33343334 &.{ lhs, rhs },
33353335 "",
33363336 );
......@@ -3342,7 +3342,7 @@ fn airSlice(self: *FuncGen, inst: Air.Inst.Index) Allocator.Error!Builder.Value
33423342 const ptr = try self.resolveInst(bin_op.lhs);
33433343 const len = try self.resolveInst(bin_op.rhs);
33443344 const inst_ty = self.typeOfIndex(inst);
3345 return self.wip.buildAggregate(try self.object.lowerType(inst_ty, .by_value), &.{ ptr, len }, "");
3345 return self.wip.buildAggregate(try self.object.lowerType(inst_ty, .as_value), &.{ ptr, len }, "");
33463346}
33473347
33483348fn airAdd(self: *FuncGen, inst: Air.Inst.Index, fast: Builder.FastMathKind) Allocator.Error!Builder.Value {
......@@ -3373,7 +3373,7 @@ fn airSafeArithmetic(
33733373 const scalar_ty = inst_ty.scalarType(zcu);
33743374
33753375 const intrinsic = if (scalar_ty.isSignedInt(zcu)) signed_intrinsic else unsigned_intrinsic;
3376 const llvm_inst_ty = try o.lowerType(inst_ty, .by_value);
3376 const llvm_inst_ty = try o.lowerType(inst_ty, .as_value);
33773377 const results =
33783378 try fg.wip.callIntrinsic(.normal, .none, intrinsic, &.{llvm_inst_ty}, &.{ lhs, rhs }, "");
33793379
......@@ -3423,7 +3423,7 @@ fn airAddSat(self: *FuncGen, inst: Air.Inst.Index) Allocator.Error!Builder.Value
34233423 .normal,
34243424 .none,
34253425 if (scalar_ty.isSignedInt(zcu)) .@"sadd.sat" else .@"uadd.sat",
3426 &.{try o.lowerType(inst_ty, .by_value)},
3426 &.{try o.lowerType(inst_ty, .as_value)},
34273427 &.{ lhs, rhs },
34283428 "",
34293429 );
......@@ -3462,7 +3462,7 @@ fn airSubSat(self: *FuncGen, inst: Air.Inst.Index) Allocator.Error!Builder.Value
34623462 .normal,
34633463 .none,
34643464 if (scalar_ty.isSignedInt(zcu)) .@"ssub.sat" else .@"usub.sat",
3465 &.{try o.lowerType(inst_ty, .by_value)},
3465 &.{try o.lowerType(inst_ty, .as_value)},
34663466 &.{ lhs, rhs },
34673467 "",
34683468 );
......@@ -3501,7 +3501,7 @@ fn airMulSat(self: *FuncGen, inst: Air.Inst.Index) Allocator.Error!Builder.Value
35013501 .normal,
35023502 .none,
35033503 if (scalar_ty.isSignedInt(zcu)) .@"smul.fix.sat" else .@"umul.fix.sat",
3504 &.{try o.lowerType(inst_ty, .by_value)},
3504 &.{try o.lowerType(inst_ty, .as_value)},
35053505 &.{ lhs, rhs, .@"0" },
35063506 "",
35073507 );
......@@ -3545,8 +3545,8 @@ fn airDivFloor(self: *FuncGen, inst: Air.Inst.Index, fast: Builder.FastMathKind)
35453545 return self.buildFloatOp(.floor, fast, inst_ty, 1, .{result});
35463546 }
35473547 if (scalar_ty.isSignedInt(zcu)) {
3548 const scalar_llvm_ty = try o.lowerType(scalar_ty, .by_value);
3549 const inst_llvm_ty = try o.lowerType(inst_ty, .by_value);
3548 const scalar_llvm_ty = try o.lowerType(scalar_ty, .as_value);
3549 const inst_llvm_ty = try o.lowerType(inst_ty, .as_value);
35503550
35513551 const ExpectedContents = [std.math.big.int.calcTwosCompLimbCount(256)]std.math.big.Limb;
35523552 var bfa_buf: ExpectedContents = undefined;
......@@ -3594,8 +3594,8 @@ fn airDivCeil(self: *FuncGen, inst: Air.Inst.Index, fast: Builder.FastMathKind)
35943594 return self.buildFloatOp(.ceil, fast, inst_ty, 1, .{result});
35953595 }
35963596 if (scalar_ty.isSignedInt(zcu)) {
3597 const scalar_llvm_ty = try o.lowerType(scalar_ty, .by_value);
3598 const inst_llvm_ty = try o.lowerType(inst_ty, .by_value);
3597 const scalar_llvm_ty = try o.lowerType(scalar_ty, .as_value);
3598 const inst_llvm_ty = try o.lowerType(inst_ty, .as_value);
35993599
36003600 const ExpectedContents = [std.math.big.int.calcTwosCompLimbCount(256)]std.math.big.Limb;
36013601 var bfa_buf: ExpectedContents = undefined;
......@@ -3634,8 +3634,8 @@ fn airDivCeil(self: *FuncGen, inst: Air.Inst.Index, fast: Builder.FastMathKind)
36343634 const correction = try self.wip.cast(.zext, need_correction, inst_llvm_ty, "divCeil.correction");
36353635 return self.wip.bin(.@"add nsw", div, correction, "divCeil");
36363636 } else {
3637 const scalar_llvm_ty = try o.lowerType(scalar_ty, .by_value);
3638 const inst_llvm_ty = try o.lowerType(inst_ty, .by_value);
3637 const scalar_llvm_ty = try o.lowerType(scalar_ty, .as_value);
3638 const inst_llvm_ty = try o.lowerType(inst_ty, .as_value);
36393639
36403640 const zero = try o.builder.splatValue(
36413641 inst_llvm_ty,
......@@ -3692,7 +3692,7 @@ fn airMod(self: *FuncGen, inst: Air.Inst.Index, fast: Builder.FastMathKind) Allo
36923692 const lhs = try self.resolveInst(bin_op.lhs);
36933693 const rhs = try self.resolveInst(bin_op.rhs);
36943694 const inst_ty = self.typeOfIndex(inst);
3695 const inst_llvm_ty = try o.lowerType(inst_ty, .by_value);
3695 const inst_llvm_ty = try o.lowerType(inst_ty, .as_value);
36963696 const scalar_ty = inst_ty.scalarType(zcu);
36973697
36983698 if (scalar_ty.isRuntimeFloat()) {
......@@ -3721,7 +3721,7 @@ fn airMod(self: *FuncGen, inst: Air.Inst.Index, fast: Builder.FastMathKind) Allo
37213721 defer allocator.free(smin_big_int.limbs);
37223722 smin_big_int.setTwosCompIntLimit(.min, .signed, scalar_bits);
37233723 const smin = try o.builder.splatValue(inst_llvm_ty, try o.builder.bigIntConst(
3724 try o.lowerType(scalar_ty, .by_value),
3724 try o.lowerType(scalar_ty, .as_value),
37253725 smin_big_int.toConst(),
37263726 ));
37273727
......@@ -3757,7 +3757,7 @@ fn airPtrSub(self: *FuncGen, inst: Air.Inst.Index) Allocator.Error!Builder.Value
37573757 const ty_pl = self.air.instructions.items(.data)[@backingInt(inst)].ty_pl;
37583758 const bin_op = self.air.extraData(Air.Bin, ty_pl.payload).data;
37593759 const ptr_or_slice = try self.resolveInst(bin_op.lhs);
3760 const llvm_usize_ty = try o.lowerType(.usize, .by_value);
3760 const llvm_usize_ty = try o.lowerType(.usize, .as_value);
37613761 const ptr_ty = self.typeOf(bin_op.lhs);
37623762 const elem_ty = ptr_ty.indexableElem(zcu);
37633763 const ptr = switch (ptr_ty.ptrSize(zcu)) {
......@@ -3790,7 +3790,7 @@ fn airOverflow(
37903790 assert(isByRef(inst_ty, zcu)); // auto structs are by-ref
37913791
37923792 const intrinsic = if (scalar_ty.isSignedInt(zcu)) signed_intrinsic else unsigned_intrinsic;
3793 const llvm_lhs_ty = try o.lowerType(lhs_ty, .by_value);
3793 const llvm_lhs_ty = try o.lowerType(lhs_ty, .as_value);
37943794 const results =
37953795 try self.wip.callIntrinsic(.normal, .none, intrinsic, &.{llvm_lhs_ty}, &.{ lhs, rhs }, "");
37963796
......@@ -3863,7 +3863,7 @@ fn buildFloatCmp(
38633863 const zcu = o.zcu;
38643864 const target = zcu.getTarget();
38653865 const scalar_ty = ty.scalarType(zcu);
3866 const scalar_llvm_ty = try o.lowerType(scalar_ty, .by_value);
3866 const scalar_llvm_ty = try o.lowerType(scalar_ty, .as_value);
38673867
38683868 if (intrinsicsAllowed(scalar_ty, target)) {
38693869 const cond: Builder.FloatCondition = switch (pred) {
......@@ -3969,7 +3969,7 @@ fn buildFloatOp(
39693969 const zcu = o.zcu;
39703970 const target = zcu.getTarget();
39713971 const scalar_ty = ty.scalarType(zcu);
3972 const llvm_ty = try o.lowerType(ty, .by_value);
3972 const llvm_ty = try o.lowerType(ty, .as_value);
39733973
39743974 if (op != .tan and intrinsicsAllowed(scalar_ty, target)) switch (op) {
39753975 // Some operations are dedicated LLVM instructions, not available as intrinsics
......@@ -4074,7 +4074,7 @@ fn buildFloatOp(
40744074 }),
40754075 };
40764076
4077 const scalar_llvm_ty = try o.lowerType(scalar_ty, .by_value);
4077 const scalar_llvm_ty = try o.lowerType(scalar_ty, .as_value);
40784078 const libc_fn = try o.getLibcFunction(
40794079 fn_name,
40804080 @as([3]Builder.Type, @splat(scalar_llvm_ty))[0..params.len],
......@@ -4129,7 +4129,7 @@ fn airShlWithOverflow(self: *FuncGen, inst: Air.Inst.Index) Allocator.Error!Buil
41294129 const dest_ty = self.typeOfIndex(inst);
41304130 assert(isByRef(dest_ty, zcu)); // auto structs are by-ref
41314131
4132 const casted_rhs = try self.wip.conv(.unsigned, rhs, try o.lowerType(lhs_ty, .by_value), "");
4132 const casted_rhs = try self.wip.conv(.unsigned, rhs, try o.lowerType(lhs_ty, .as_value), "");
41334133
41344134 const result = try self.wip.bin(.shl, lhs, casted_rhs, "");
41354135 const reconstructed = try self.wip.bin(if (lhs_scalar_ty.isSignedInt(zcu))
......@@ -4196,7 +4196,7 @@ fn airShlExact(self: *FuncGen, inst: Air.Inst.Index) Allocator.Error!Builder.Val
41964196 }
41974197 const lhs_scalar_ty = lhs_ty.scalarType(zcu);
41984198
4199 const casted_rhs = try self.wip.conv(.unsigned, rhs, try o.lowerType(lhs_ty, .by_value), "");
4199 const casted_rhs = try self.wip.conv(.unsigned, rhs, try o.lowerType(lhs_ty, .as_value), "");
42004200 return self.wip.bin(if (lhs_scalar_ty.isSignedInt(zcu))
42014201 .@"shl nsw"
42024202 else
......@@ -4217,7 +4217,7 @@ fn airShl(self: *FuncGen, inst: Air.Inst.Index) Allocator.Error!Builder.Value {
42174217 // features which we do not use. Therefore this branch is currently impossible.
42184218 unreachable;
42194219 }
4220 const casted_rhs = try self.wip.conv(.unsigned, rhs, try o.lowerType(lhs_ty, .by_value), "");
4220 const casted_rhs = try self.wip.conv(.unsigned, rhs, try o.lowerType(lhs_ty, .as_value), "");
42214221 return self.wip.bin(.shl, lhs, casted_rhs, "");
42224222}
42234223
......@@ -4231,8 +4231,8 @@ fn airShlSat(self: *FuncGen, inst: Air.Inst.Index) Allocator.Error!Builder.Value
42314231
42324232 const lhs_ty = self.typeOf(bin_op.lhs);
42334233 const lhs_info = lhs_ty.intInfo(zcu);
4234 const llvm_lhs_ty = try o.lowerType(lhs_ty, .by_value);
4235 const llvm_lhs_scalar_ty = try o.lowerType(lhs_ty.scalarType(zcu), .by_value);
4234 const llvm_lhs_ty = try o.lowerType(lhs_ty, .as_value);
4235 const llvm_lhs_scalar_ty = try o.lowerType(lhs_ty.scalarType(zcu), .as_value);
42364236
42374237 const rhs_ty = self.typeOf(bin_op.rhs);
42384238 if (lhs_ty.isVector(zcu) and !rhs_ty.isVector(zcu)) {
......@@ -4242,8 +4242,8 @@ fn airShlSat(self: *FuncGen, inst: Air.Inst.Index) Allocator.Error!Builder.Value
42424242 }
42434243 const rhs_info = rhs_ty.intInfo(zcu);
42444244 assert(rhs_info.signedness == .unsigned);
4245 const llvm_rhs_ty = try o.lowerType(rhs_ty, .by_value);
4246 const llvm_rhs_scalar_ty = try o.lowerType(rhs_ty.scalarType(zcu), .by_value);
4245 const llvm_rhs_ty = try o.lowerType(rhs_ty, .as_value);
4246 const llvm_rhs_scalar_ty = try o.lowerType(rhs_ty.scalarType(zcu), .as_value);
42474247
42484248 const result = try self.wip.callIntrinsic(
42494249 .normal,
......@@ -4319,7 +4319,7 @@ fn airShr(self: *FuncGen, inst: Air.Inst.Index, is_exact: bool) Allocator.Error!
43194319 }
43204320 const lhs_scalar_ty = lhs_ty.scalarType(zcu);
43214321
4322 const casted_rhs = try self.wip.conv(.unsigned, rhs, try o.lowerType(lhs_ty, .by_value), "");
4322 const casted_rhs = try self.wip.conv(.unsigned, rhs, try o.lowerType(lhs_ty, .as_value), "");
43234323 const is_signed_int = lhs_scalar_ty.isSignedInt(zcu);
43244324
43254325 return self.wip.bin(if (is_exact)
......@@ -4340,7 +4340,7 @@ fn airAbs(self: *FuncGen, inst: Air.Inst.Index) Allocator.Error!Builder.Value {
43404340 .normal,
43414341 .none,
43424342 .abs,
4343 &.{try o.lowerType(operand_ty, .by_value)},
4343 &.{try o.lowerType(operand_ty, .as_value)},
43444344 &.{ operand, .false },
43454345 "",
43464346 ),
......@@ -4354,7 +4354,7 @@ fn airIntCast(fg: *FuncGen, inst: Air.Inst.Index, safety: bool) Allocator.Error!
43544354 const zcu = o.zcu;
43554355 const ty_op = fg.air.instructions.items(.data)[@backingInt(inst)].ty_op;
43564356 const dest_ty = fg.typeOfIndex(inst);
4357 const dest_llvm_ty = try o.lowerType(dest_ty, .by_value);
4357 const dest_llvm_ty = try o.lowerType(dest_ty, .as_value);
43584358 const operand = try fg.resolveInst(ty_op.operand);
43594359 const operand_ty = fg.typeOf(ty_op.operand);
43604360 const operand_info = operand_ty.intInfo(zcu);
......@@ -4382,8 +4382,8 @@ fn airIntCast(fg: *FuncGen, inst: Air.Inst.Index, safety: bool) Allocator.Error!
43824382
43834383 if (!have_min_check and !have_max_check) break :bounds_check;
43844384
4385 const operand_llvm_ty = try o.lowerType(operand_ty, .by_value);
4386 const operand_scalar_llvm_ty = try o.lowerType(operand_scalar, .by_value);
4385 const operand_llvm_ty = try o.lowerType(operand_ty, .as_value);
4386 const operand_scalar_llvm_ty = try o.lowerType(operand_scalar, .as_value);
43874387
43884388 const is_vector = operand_ty.zigTypeTag(zcu) == .vector;
43894389 assert(is_vector == (dest_ty.zigTypeTag(zcu) == .vector));
......@@ -4461,7 +4461,7 @@ fn airIntCast(fg: *FuncGen, inst: Air.Inst.Index, safety: bool) Allocator.Error!
44614461fn airTrunc(self: *FuncGen, inst: Air.Inst.Index) Allocator.Error!Builder.Value {
44624462 const ty_op = self.air.instructions.items(.data)[@backingInt(inst)].ty_op;
44634463 const operand = try self.resolveInst(ty_op.operand);
4464 const dest_llvm_ty = try self.object.lowerType(self.typeOfIndex(inst), .by_value);
4464 const dest_llvm_ty = try self.object.lowerType(self.typeOfIndex(inst), .as_value);
44654465 return self.wip.cast(.trunc, operand, dest_llvm_ty, "");
44664466}
44674467
......@@ -4475,10 +4475,10 @@ fn airFptrunc(self: *FuncGen, inst: Air.Inst.Index) Allocator.Error!Builder.Valu
44754475 const target = zcu.getTarget();
44764476
44774477 if (intrinsicsAllowed(dest_ty, target) and intrinsicsAllowed(operand_ty, target)) {
4478 return self.wip.cast(.fptrunc, operand, try o.lowerType(dest_ty, .by_value), "");
4478 return self.wip.cast(.fptrunc, operand, try o.lowerType(dest_ty, .as_value), "");
44794479 } else {
4480 const operand_llvm_ty = try o.lowerType(operand_ty, .by_value);
4481 const dest_llvm_ty = try o.lowerType(dest_ty, .by_value);
4480 const operand_llvm_ty = try o.lowerType(operand_ty, .as_value);
4481 const dest_llvm_ty = try o.lowerType(dest_ty, .as_value);
44824482
44834483 const dest_bits = dest_ty.floatBits(target);
44844484 const src_bits = operand_ty.floatBits(target);
......@@ -4509,10 +4509,10 @@ fn airFpext(self: *FuncGen, inst: Air.Inst.Index) Allocator.Error!Builder.Value
45094509 const target = zcu.getTarget();
45104510
45114511 if (intrinsicsAllowed(dest_ty, target) and intrinsicsAllowed(operand_ty, target)) {
4512 return self.wip.cast(.fpext, operand, try o.lowerType(dest_ty, .by_value), "");
4512 return self.wip.cast(.fpext, operand, try o.lowerType(dest_ty, .as_value), "");
45134513 } else {
4514 const operand_llvm_ty = try o.lowerType(operand_ty, .by_value);
4515 const dest_llvm_ty = try o.lowerType(dest_ty, .by_value);
4514 const operand_llvm_ty = try o.lowerType(operand_ty, .as_value);
4515 const dest_llvm_ty = try o.lowerType(dest_ty, .as_value);
45164516
45174517 const dest_bits = dest_ty.scalarType(zcu).floatBits(target);
45184518 const src_bits = operand_ty.scalarType(zcu).floatBits(target);
......@@ -4563,7 +4563,7 @@ fn airBitCast(fg: *FuncGen, inst: Air.Inst.Index, safety: bool) Allocator.Error!
45634563 assert(!isByRef(operand_ty, zcu));
45644564 assert(!isByRef(dest_ty, zcu));
45654565
4566 const llvm_dest_ty = try o.lowerType(dest_ty, .by_value);
4566 const llvm_dest_ty = try o.lowerType(dest_ty, .as_value);
45674567 const result = try fg.wip.cast(.bitcast, operand, llvm_dest_ty, "");
45684568 if (safety and dest_ty.zigTypeTag(zcu) == .@"enum" and !dest_ty.isNonexhaustiveEnum(zcu)) {
45694569 const llvm_fn = try o.getIsNamedEnumValueFunction(dest_ty);
......@@ -4606,7 +4606,7 @@ fn airPtrFromInt(fg: *FuncGen, inst: Air.Inst.Index) Allocator.Error!Builder.Val
46064606 assert(dest_ty.scalarType(zcu).isPtrAtRuntime(zcu));
46074607
46084608 const operand = try fg.resolveInst(ty_op.operand);
4609 const llvm_dest_ty = try o.lowerType(dest_ty, .by_value);
4609 const llvm_dest_ty = try o.lowerType(dest_ty, .as_value);
46104610 return fg.wip.cast(.inttoptr, operand, llvm_dest_ty, "");
46114611}
46124612
......@@ -4620,7 +4620,7 @@ fn airIntFromPtr(fg: *FuncGen, inst: Air.Inst.Index) Allocator.Error!Builder.Val
46204620 assert(dest_ty.scalarType(zcu).toIntern() == .usize_type);
46214621
46224622 const operand = try fg.resolveInst(ty_op.operand);
4623 const llvm_dest_ty = try o.lowerType(dest_ty, .by_value);
4623 const llvm_dest_ty = try o.lowerType(dest_ty, .as_value);
46244624 return fg.wip.cast(.ptrtoint, operand, llvm_dest_ty, "");
46254625}
46264626
......@@ -4832,7 +4832,7 @@ fn airStore(fg: *FuncGen, inst: Air.Inst.Index, safety: bool) Allocator.Error!Bu
48324832 return .none;
48334833 }
48344834
4835 const len = try o.builder.intValue(try o.lowerType(.usize, .by_value), elem_ty.abiSize(zcu));
4835 const len = try o.builder.intValue(try o.lowerType(.usize, .as_value), elem_ty.abiSize(zcu));
48364836 _ = try fg.wip.callMemSet(
48374837 ptr,
48384838 ptr_alignment.toLlvm(),
......@@ -4867,7 +4867,7 @@ fn airStore(fg: *FuncGen, inst: Air.Inst.Index, safety: bool) Allocator.Error!Bu
48674867 if (ptr_info.packed_offset.host_size != 0) {
48684868 // Accepted proposal https://github.com/ziglang/zig/issues/24061 will eliminate this usage of `pt`.
48694869 const backing_int_ty = try fg.pt.intType(.unsigned, @intCast(ptr_info.packed_offset.host_size * 8));
4870 const llvm_backing_int_ty = try o.lowerType(backing_int_ty, .by_value);
4870 const llvm_backing_int_ty = try o.lowerType(backing_int_ty, .as_value);
48714871
48724872 const backing_int_val = try fg.load(ptr, ptr_alignment, backing_int_ty, access_kind);
48734873
......@@ -4945,14 +4945,14 @@ fn airLoad(fg: *FuncGen, inst: Air.Inst.Index) Allocator.Error!Builder.Value {
49454945
49464946 // Accepted proposal https://github.com/ziglang/zig/issues/24061 will eliminate this usage of `pt`.
49474947 const backing_int_ty = try fg.pt.intType(.unsigned, @intCast(ptr_info.packed_offset.host_size * 8));
4948 const llvm_backing_int_ty = try o.lowerType(backing_int_ty, .by_value);
4948 const llvm_backing_int_ty = try o.lowerType(backing_int_ty, .as_value);
49494949
49504950 const backing_int_val = try fg.load(ptr, ptr_align, backing_int_ty, .normal);
49514951
49524952 const elem_bits = ptr_ty.childType(zcu).bitSize(zcu);
49534953 const shift_amt = try o.builder.intValue(llvm_backing_int_ty, ptr_info.packed_offset.bit_offset);
49544954 const shifted_value = try fg.wip.bin(.lshr, backing_int_val, shift_amt, "");
4955 const elem_llvm_ty = try o.lowerType(elem_ty, .by_value);
4955 const elem_llvm_ty = try o.lowerType(elem_ty, .as_value);
49564956
49574957 if (elem_ty.zigTypeTag(zcu) == .float or elem_ty.zigTypeTag(zcu) == .vector) {
49584958 const same_size_int = try o.builder.intType(@intCast(elem_bits));
......@@ -5002,7 +5002,7 @@ fn airBreakpoint(self: *FuncGen, inst: Air.Inst.Index) Allocator.Error!Builder.V
50025002fn airRetAddr(self: *FuncGen, inst: Air.Inst.Index) Allocator.Error!Builder.Value {
50035003 _ = inst;
50045004 const o = self.object;
5005 const llvm_usize = try o.lowerType(.usize, .by_value);
5005 const llvm_usize = try o.lowerType(.usize, .as_value);
50065006 if (!target_util.supportsReturnAddress(self.object.zcu.getTarget(), self.ownerModule().optimize_mode)) {
50075007 // https://github.com/ziglang/zig/issues/11946
50085008 return o.builder.intValue(llvm_usize, 0);
......@@ -5014,7 +5014,7 @@ fn airRetAddr(self: *FuncGen, inst: Air.Inst.Index) Allocator.Error!Builder.Valu
50145014fn airFrameAddress(self: *FuncGen, inst: Air.Inst.Index) Allocator.Error!Builder.Value {
50155015 _ = inst;
50165016 const result = try self.wip.callIntrinsic(.normal, .none, .frameaddress, &.{.ptr}, &.{.@"0"}, "");
5017 return self.wip.cast(.ptrtoint, result, try self.object.lowerType(.usize, .by_value), "");
5017 return self.wip.cast(.ptrtoint, result, try self.object.lowerType(.usize, .as_value), "");
50185018}
50195019
50205020fn airCmpxchg(
......@@ -5031,7 +5031,7 @@ fn airCmpxchg(
50315031 var expected_value = try self.resolveInst(extra.expected_value);
50325032 var new_value = try self.resolveInst(extra.new_value);
50335033 const operand_ty = ptr_ty.childType(zcu);
5034 const llvm_operand_ty = try o.lowerType(operand_ty, .by_value);
5034 const llvm_operand_ty = try o.lowerType(operand_ty, .as_value);
50355035 const llvm_abi_ty = try self.getAtomicAbiType(operand_ty, false);
50365036 if (llvm_abi_ty != .none) {
50375037 // operand needs widening and truncating
......@@ -5101,7 +5101,7 @@ fn airAtomicRmw(self: *FuncGen, inst: Air.Inst.Index) Allocator.Error!Builder.Va
51015101 const op = toLlvmAtomicRmwBinOp(extra.op(), is_signed_int, is_float);
51025102 const ordering = toLlvmAtomicOrdering(extra.ordering());
51035103 const llvm_abi_ty = try self.getAtomicAbiType(operand_ty, op == .xchg);
5104 const llvm_operand_ty = try o.lowerType(operand_ty, .by_value);
5104 const llvm_operand_ty = try o.lowerType(operand_ty, .as_value);
51055105
51065106 const access_kind: Builder.MemoryAccessKind =
51075107 if (ptr_ty.isVolatilePtr(zcu)) .@"volatile" else .normal;
......@@ -5130,7 +5130,7 @@ fn airAtomicRmw(self: *FuncGen, inst: Air.Inst.Index) Allocator.Error!Builder.Va
51305130
51315131 // If we are storing a pointer we need to convert to and from a plain old integer.
51325132 const non_ptr_operand = switch (operand_ty.zigTypeTag(zcu)) {
5133 .pointer => try self.wip.cast(.ptrtoint, operand, try o.lowerType(.usize, .by_value), ""),
5133 .pointer => try self.wip.cast(.ptrtoint, operand, try o.lowerType(.usize, .as_value), ""),
51345134 else => operand,
51355135 };
51365136
......@@ -5169,7 +5169,7 @@ fn airAtomicLoad(self: *FuncGen, inst: Air.Inst.Index) Allocator.Error!Builder.V
51695169 Type.fromInterned(info.child).abiAlignment(zcu)).toLlvm();
51705170 const access_kind: Builder.MemoryAccessKind =
51715171 if (info.flags.is_volatile) .@"volatile" else .normal;
5172 const elem_llvm_ty = try o.lowerType(elem_ty, .by_value);
5172 const elem_llvm_ty = try o.lowerType(elem_ty, .as_value);
51735173
51745174 self.maybeMarkAllowZeroAccess(info);
51755175
......@@ -5503,11 +5503,11 @@ fn airClzCtz(self: *FuncGen, inst: Air.Inst.Index, intrinsic: Builder.Intrinsic)
55035503 .normal,
55045504 .none,
55055505 intrinsic,
5506 &.{try o.lowerType(operand_ty, .by_value)},
5506 &.{try o.lowerType(operand_ty, .as_value)},
55075507 &.{ operand, .false },
55085508 "",
55095509 );
5510 return self.wip.conv(.unsigned, result, try o.lowerType(inst_ty, .by_value), "");
5510 return self.wip.conv(.unsigned, result, try o.lowerType(inst_ty, .as_value), "");
55115511}
55125512
55135513fn airBitOp(self: *FuncGen, inst: Air.Inst.Index, intrinsic: Builder.Intrinsic) Allocator.Error!Builder.Value {
......@@ -5521,11 +5521,11 @@ fn airBitOp(self: *FuncGen, inst: Air.Inst.Index, intrinsic: Builder.Intrinsic)
55215521 .normal,
55225522 .none,
55235523 intrinsic,
5524 &.{try o.lowerType(operand_ty, .by_value)},
5524 &.{try o.lowerType(operand_ty, .as_value)},
55255525 &.{operand},
55265526 "",
55275527 );
5528 return self.wip.conv(.unsigned, result, try o.lowerType(inst_ty, .by_value), "");
5528 return self.wip.conv(.unsigned, result, try o.lowerType(inst_ty, .as_value), "");
55295529}
55305530
55315531fn airByteSwap(self: *FuncGen, inst: Air.Inst.Index) Allocator.Error!Builder.Value {
......@@ -5538,7 +5538,7 @@ fn airByteSwap(self: *FuncGen, inst: Air.Inst.Index) Allocator.Error!Builder.Val
55385538
55395539 const inst_ty = self.typeOfIndex(inst);
55405540 var operand = try self.resolveInst(ty_op.operand);
5541 var llvm_operand_ty = try o.lowerType(operand_ty, .by_value);
5541 var llvm_operand_ty = try o.lowerType(operand_ty, .as_value);
55425542
55435543 if (bits % 16 == 8) {
55445544 // If not an even byte-multiple, we need zero-extend + shift-left 1 byte
......@@ -5559,7 +5559,7 @@ fn airByteSwap(self: *FuncGen, inst: Air.Inst.Index) Allocator.Error!Builder.Val
55595559
55605560 const result =
55615561 try self.wip.callIntrinsic(.normal, .none, .bswap, &.{llvm_operand_ty}, &.{operand}, "");
5562 return self.wip.conv(.unsigned, result, try o.lowerType(inst_ty, .by_value), "");
5562 return self.wip.conv(.unsigned, result, try o.lowerType(inst_ty, .as_value), "");
55635563}
55645564
55655565fn airErrorSetHasValue(self: *FuncGen, inst: Air.Inst.Index) Allocator.Error!Builder.Value {
......@@ -5579,7 +5579,7 @@ fn airErrorSetHasValue(self: *FuncGen, inst: Air.Inst.Index) Allocator.Error!Bui
55795579
55805580 for (0..names.len) |name_index| {
55815581 const err_int = ip.getErrorValueIfExists(names.get(ip)[name_index]).?;
5582 const this_tag_int_value = try o.builder.intConst(try o.errorIntType(.by_value), err_int);
5582 const this_tag_int_value = try o.builder.intConst(try o.errorIntType(.as_value), err_int);
55835583 try wip_switch.addCase(this_tag_int_value, valid_block, &self.wip);
55845584 }
55855585 self.wip.cursor = .{ .block = valid_block };
......@@ -5638,7 +5638,7 @@ fn airErrorName(self: *FuncGen, inst: Air.Inst.Index) Allocator.Error!Builder.Va
56385638 const slice_ty = self.typeOfIndex(inst);
56395639
56405640 // If operand is small (e.g. `u8`), then signedness becomes a problem -- GEP always treats the index as signed.
5641 const operand_usize = try self.wip.conv(.unsigned, operand, try o.lowerType(.usize, .by_value), "");
5641 const operand_usize = try self.wip.conv(.unsigned, operand, try o.lowerType(.usize, .as_value), "");
56425642
56435643 const error_name_table_ptr = try o.getErrorNameTable();
56445644 const error_name_ptr = try self.ptraddScaled(error_name_table_ptr.toValue(&o.builder), operand_usize, slice_ty.abiSize(zcu));
......@@ -5649,7 +5649,7 @@ fn airSplat(self: *FuncGen, inst: Air.Inst.Index) Allocator.Error!Builder.Value
56495649 const ty_op = self.air.instructions.items(.data)[@backingInt(inst)].ty_op;
56505650 const scalar = try self.resolveInst(ty_op.operand);
56515651 const vector_ty = self.typeOfIndex(inst);
5652 return self.wip.splatVector(try self.object.lowerType(vector_ty, .by_value), scalar, "");
5652 return self.wip.splatVector(try self.object.lowerType(vector_ty, .as_value), scalar, "");
56535653}
56545654
56555655fn airSelect(self: *FuncGen, inst: Air.Inst.Index) Allocator.Error!Builder.Value {
......@@ -5672,9 +5672,9 @@ fn airShuffleOne(fg: *FuncGen, inst: Air.Inst.Index) Allocator.Error!Builder.Val
56725672 const operand = try fg.resolveInst(unwrapped.operand);
56735673 const mask = unwrapped.mask;
56745674 const operand_ty = fg.typeOf(unwrapped.operand);
5675 const llvm_operand_ty = try o.lowerType(operand_ty, .by_value);
5676 const llvm_result_ty = try o.lowerType(unwrapped.result_ty, .by_value);
5677 const llvm_elem_ty = try o.lowerType(unwrapped.result_ty.childType(zcu), .by_value);
5675 const llvm_operand_ty = try o.lowerType(operand_ty, .as_value);
5676 const llvm_result_ty = try o.lowerType(unwrapped.result_ty, .as_value);
5677 const llvm_elem_ty = try o.lowerType(unwrapped.result_ty.childType(zcu), .as_value);
56785678 const llvm_poison_elem = try o.builder.poisonConst(llvm_elem_ty);
56795679 const llvm_poison_mask_elem = try o.builder.poisonConst(.i32);
56805680 const llvm_mask_ty = try o.builder.vectorType(.normal, @intCast(mask.len), .i32);
......@@ -5704,7 +5704,7 @@ fn airShuffleOne(fg: *FuncGen, inst: Air.Inst.Index) Allocator.Error!Builder.Val
57045704 .elem => llvm_poison_elem,
57055705 .value => |val| if (!Value.fromInterned(val).isUndef(zcu)) elem: {
57065706 any_defined_comptime_value = true;
5707 break :elem try o.lowerValue(val, .by_value);
5707 break :elem try o.lowerValue(val, .as_value);
57085708 } else llvm_poison_elem,
57095709 };
57105710 }
......@@ -5776,7 +5776,7 @@ fn airShuffleTwo(fg: *FuncGen, inst: Air.Inst.Index) Allocator.Error!Builder.Val
57765776 const unwrapped = fg.air.unwrapShuffleTwo(zcu, inst);
57775777
57785778 const mask = unwrapped.mask;
5779 const llvm_elem_ty = try o.lowerType(unwrapped.result_ty.childType(zcu), .by_value);
5779 const llvm_elem_ty = try o.lowerType(unwrapped.result_ty.childType(zcu), .as_value);
57805780 const llvm_mask_ty = try o.builder.vectorType(.normal, @intCast(mask.len), .i32);
57815781 const llvm_poison_mask_elem = try o.builder.poisonConst(.i32);
57825782
......@@ -5866,7 +5866,7 @@ fn buildReducedCall(
58665866 accum_init: Builder.Value,
58675867) Allocator.Error!Builder.Value {
58685868 const o = self.object;
5869 const llvm_usize_ty = try o.lowerType(.usize, .by_value);
5869 const llvm_usize_ty = try o.lowerType(.usize, .as_value);
58705870 const llvm_vector_len = try o.builder.intValue(llvm_usize_ty, vector_len);
58715871 const llvm_result_ty = accum_init.typeOfWip(&self.wip);
58725872
......@@ -5924,9 +5924,9 @@ fn airReduce(self: *FuncGen, inst: Air.Inst.Index, fast: Builder.FastMathKind) A
59245924 const reduce = self.air.instructions.items(.data)[@backingInt(inst)].reduce;
59255925 const operand = try self.resolveInst(reduce.operand);
59265926 const operand_ty = self.typeOf(reduce.operand);
5927 const llvm_operand_ty = try o.lowerType(operand_ty, .by_value);
5927 const llvm_operand_ty = try o.lowerType(operand_ty, .as_value);
59285928 const scalar_ty = self.typeOfIndex(inst);
5929 const llvm_scalar_ty = try o.lowerType(scalar_ty, .by_value);
5929 const llvm_scalar_ty = try o.lowerType(scalar_ty, .as_value);
59305930
59315931 switch (reduce.operation) {
59325932 .And, .Or, .Xor => return self.wip.callIntrinsic(.normal, .none, switch (reduce.operation) {
......@@ -6036,7 +6036,7 @@ fn airAggregateInit(self: *FuncGen, inst: Air.Inst.Index) Allocator.Error!Builde
60366036
60376037 switch (result_ty.zigTypeTag(zcu)) {
60386038 .vector => {
6039 const llvm_result_ty = try o.lowerType(result_ty, .by_value);
6039 const llvm_result_ty = try o.lowerType(result_ty, .as_value);
60406040 var vector = try o.builder.poisonValue(llvm_result_ty);
60416041 for (elements, 0..) |elem, i| {
60426042 const index_u32 = try o.builder.intValue(.i32, i);
......@@ -6153,10 +6153,10 @@ fn airUnionInit(self: *FuncGen, inst: Air.Inst.Index) Allocator.Error!Builder.Va
61536153 const loaded_enum = ip.loadEnumType(tag_ty.toIntern());
61546154 const llvm_tag_val = switch (loaded_enum.field_values.getOrNone(ip, extra.field_index)) {
61556155 .none => try o.builder.intConst(
6156 try o.lowerType(.fromInterned(union_obj.enum_tag_type), .by_value),
6156 try o.lowerType(.fromInterned(union_obj.enum_tag_type), .as_value),
61576157 extra.field_index, // auto-numbered
61586158 ),
6159 else => |tag_val_ip| try o.lowerValue(tag_val_ip, .by_value),
6159 else => |tag_val_ip| try o.lowerValue(tag_val_ip, .as_value),
61606160 };
61616161 const tag_ptr = try self.ptraddConst(result_ptr, layout.tagOffset());
61626162 try self.store(tag_ptr, layout.tag_align, llvm_tag_val.toValue(), tag_ty, .normal);
......@@ -6218,7 +6218,7 @@ fn airAddrSpaceCast(self: *FuncGen, inst: Air.Inst.Index) Allocator.Error!Builde
62186218 const ty_op = self.air.instructions.items(.data)[@backingInt(inst)].ty_op;
62196219 const inst_ty = self.typeOfIndex(inst);
62206220 const operand = try self.resolveInst(ty_op.operand);
6221 return self.wip.cast(.addrspacecast, operand, try self.object.lowerType(inst_ty, .by_value), "");
6221 return self.wip.cast(.addrspacecast, operand, try self.object.lowerType(inst_ty, .as_value), "");
62226222}
62236223
62246224fn workIntrinsic(
......@@ -6370,7 +6370,7 @@ fn load(
63706370 };
63716371
63726372 if (isByRef(load_ty, zcu)) {
6373 const llvm_usize_ty = try o.lowerType(.usize, .by_value);
6373 const llvm_usize_ty = try o.lowerType(.usize, .as_value);
63746374 const result_ptr = try fg.buildZigAlloca(load_ty, .none);
63756375 _ = try fg.wip.callMemCpy(
63766376 result_ptr,
......@@ -6385,7 +6385,7 @@ fn load(
63856385 }
63866386
63876387 const llvm_memory_ty = try o.lowerType(load_ty, .in_memory);
6388 const llvm_value_ty = try o.lowerType(load_ty, .by_value);
6388 const llvm_value_ty = try o.lowerType(load_ty, .as_value);
63896389
63906390 if (llvm_memory_ty != llvm_value_ty) {
63916391 assert(load_ty.isAbiInt(zcu));
......@@ -6443,7 +6443,7 @@ fn store(
64436443 };
64446444
64456445 if (isByRef(elem_ty, zcu)) {
6446 const llvm_usize_ty = try o.lowerType(.usize, .by_value);
6446 const llvm_usize_ty = try o.lowerType(.usize, .as_value);
64476447 _ = try fg.wip.callMemCpy(
64486448 ptr,
64496449 llvm_ptr_align,
......@@ -6456,10 +6456,10 @@ fn store(
64566456 return;
64576457 }
64586458
6459 assert(elem.typeOfWip(&fg.wip) == try o.lowerType(elem_ty, .by_value));
6459 assert(elem.typeOfWip(&fg.wip) == try o.lowerType(elem_ty, .as_value));
64606460
64616461 const llvm_memory_ty = try o.lowerType(elem_ty, .in_memory);
6462 const llvm_value_ty = try o.lowerType(elem_ty, .by_value);
6462 const llvm_value_ty = try o.lowerType(elem_ty, .as_value);
64636463
64646464 if (llvm_memory_ty != llvm_value_ty) {
64656465 assert(elem_ty.isAbiInt(zcu));
......@@ -6494,7 +6494,7 @@ fn store(
64946494fn valgrindMarkUndef(fg: *FuncGen, ptr: Builder.Value, len: Builder.Value) Allocator.Error!void {
64956495 const VG_USERREQ__MAKE_MEM_UNDEFINED = 1296236545;
64966496 const o = fg.object;
6497 const usize_ty = try o.lowerType(.usize, .by_value);
6497 const usize_ty = try o.lowerType(.usize, .as_value);
64986498 const zero = try o.builder.intValue(usize_ty, 0);
64996499 const req = try o.builder.intValue(usize_ty, VG_USERREQ__MAKE_MEM_UNDEFINED);
65006500 const ptr_as_usize = try fg.wip.cast(.ptrtoint, ptr, usize_ty, "");
......@@ -6516,7 +6516,7 @@ fn valgrindClientRequest(
65166516 const target = zcu.getTarget();
65176517 if (!target_util.hasValgrindSupport(target, .stage2_llvm)) return default_value;
65186518
6519 const llvm_usize = try o.lowerType(.usize, .by_value);
6519 const llvm_usize = try o.lowerType(.usize, .as_value);
65206520 const usize_align = Type.usize.abiAlignment(zcu).toLlvm();
65216521
65226522 const array_llvm_ty = try o.builder.arrayType(6, llvm_usize);
......@@ -6798,7 +6798,7 @@ const ParamTypeIterator = struct {
67986798 while (field_it.next()) |field_index| {
67996799 const field_ty = ty.fieldType(field_index, zcu);
68006800 if (!field_ty.hasRuntimeBits(zcu)) continue;
6801 it.types_buffer[it.types_len] = try it.object.lowerType(field_ty, .by_value);
6801 it.types_buffer[it.types_len] = try it.object.lowerType(field_ty, .as_value);
68026802 it.offsets_buffer[it.types_len] = ty.structFieldOffset(field_index, zcu);
68036803 it.types_len += 1;
68046804 }
......@@ -6815,7 +6815,7 @@ const ParamTypeIterator = struct {
68156815 it.llvm_index += 1;
68166816 return .byval;
68176817 } else {
6818 it.types_buffer[0..1].* = .{try it.object.lowerType(scalar_ty, .by_value)};
6818 it.types_buffer[0..1].* = .{try it.object.lowerType(scalar_ty, .as_value)};
68196819 it.offsets_buffer[0..2].* = .{ 0, scalar_ty.abiSize(zcu) };
68206820 it.types_len = 1;
68216821 it.llvm_index += 1;
......@@ -7080,7 +7080,7 @@ pub fn fnReturnStrat(o: *Object, fn_info: InternPool.Key.FuncType) Allocator.Err
70807080 for (0..ret_ty.structFieldCount(zcu)) |field_index| {
70817081 const field_ty = ret_ty.fieldType(field_index, zcu);
70827082 if (!field_ty.hasRuntimeBits(zcu)) continue;
7083 types[types_len] = try o.lowerType(field_ty, .by_value);
7083 types[types_len] = try o.lowerType(field_ty, .as_value);
70847084 types_len += 1;
70857085 }
70867086 return .{ .mem_cast = try o.builder.structType(.normal, types[0..types_len]) };
......@@ -7091,7 +7091,7 @@ pub fn fnReturnStrat(o: *Object, fn_info: InternPool.Key.FuncType) Allocator.Err
70917091 assert(!isByRef(ret_ty, zcu));
70927092 return .by_val;
70937093 } else {
7094 return .{ .mem_cast = try o.lowerType(scalar_ty, .by_value) };
7094 return .{ .mem_cast = try o.lowerType(scalar_ty, .as_value) };
70957095 },
70967096 .indirect => return .sret,
70977097 },
......@@ -7392,7 +7392,7 @@ fn getAtomicAbiType(fg: *const FuncGen, ty: Type, is_rmw_xchg: bool) Allocator.E
73927392fn ptraddConst(fg: *FuncGen, ptr: Builder.Value, offset: u64) Allocator.Error!Builder.Value {
73937393 if (offset == 0) return ptr;
73947394 const o = fg.object;
7395 const llvm_usize_ty = try o.lowerType(.usize, .by_value);
7395 const llvm_usize_ty = try o.lowerType(.usize, .as_value);
73967396 const offset_val = try o.builder.intValue(llvm_usize_ty, offset);
73977397 return fg.wip.gep(.inbounds, .i8, ptr, &.{offset_val}, "");
73987398}