From 3550cacd73b40cea5cfe3d9613bb4f80b5d42417 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20R=C3=B8nne=20Petersen?= Date: Sun, 6 Oct 2024 11:47:35 +0200 Subject: [PATCH] llvm: Fix compiler crash when lowering f16 for riscv32 ilp32. --- src/codegen/llvm.zig | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/src/codegen/llvm.zig b/src/codegen/llvm.zig index bd59cef569..7cb7d6f61f 100644 --- a/src/codegen/llvm.zig +++ b/src/codegen/llvm.zig @@ -1687,12 +1687,6 @@ pub const Object = struct { else try wip.load(.normal, param_llvm_ty, arg_ptr, param_alignment, "")); }, - .as_u16 => { - assert(!it.byval_attr); - const param = wip.arg(llvm_arg_i); - llvm_arg_i += 1; - args.appendAssumeCapacity(try wip.cast(.bitcast, param, .half, "")); - }, .float_array => { const param_ty = Type.fromInterned(fn_info.param_types.get(ip)[it.zig_index - 1]); const param_llvm_ty = try o.lowerType(param_ty); @@ -3095,7 +3089,6 @@ pub const Object = struct { .no_bits, .abi_sized_int, .multiple_llvm_types, - .as_u16, .float_array, .i32_array, .i64_array, @@ -3770,9 +3763,6 @@ pub const Object = struct { .multiple_llvm_types => { try llvm_params.appendSlice(o.gpa, it.types_buffer[0..it.types_len]); }, - .as_u16 => { - try llvm_params.append(o.gpa, .i16); - }, .float_array => |count| { const param_ty = Type.fromInterned(fn_info.param_types.get(ip)[it.zig_index - 1]); const float_ty = try o.lowerType(aarch64_c_abi.getFloatArrayType(param_ty, zcu).?); @@ -5587,12 +5577,6 @@ pub const FuncGen = struct { llvm_args.appendAssumeCapacity(loaded); } }, - .as_u16 => { - const arg = args[it.zig_index - 1]; - const llvm_arg = try self.resolveInst(arg); - const casted = try self.wip.cast(.bitcast, llvm_arg, .i16, ""); - try llvm_args.append(casted); - }, .float_array => |count| { const arg = args[it.zig_index - 1]; const arg_ty = self.typeOf(arg); @@ -5654,7 +5638,6 @@ pub const FuncGen = struct { .no_bits, .abi_sized_int, .multiple_llvm_types, - .as_u16, .float_array, .i32_array, .i64_array, @@ -11968,7 +11951,6 @@ const ParamTypeIterator = struct { abi_sized_int, multiple_llvm_types, slice, - as_u16, float_array: u8, i32_array: u8, i64_array: u8, @@ -12090,8 +12072,6 @@ const ParamTypeIterator = struct { .riscv32, .riscv64 => { it.zig_index += 1; it.llvm_index += 1; - if (ty.toIntern() == .f16_type and - !std.Target.riscv.featureSetHas(target.cpu.features, .d)) return .as_u16; switch (riscv_c_abi.classifyType(ty, zcu)) { .memory => return .byref_mut, .byval => return .byval,