authorgravatar for antoniospg100@gmail.comAntonio Gomes <antoniospg100@gmail.com> 2024-05-01 08:04:39-03:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2024-05-22 06:56:30-07:00
logc3aa32e98408c8e6e1578e573b8e2eef47fd4c54
tree0984a7d12e50b5508269e1a1059bf87b0d30a84c
parentefe06c5f31fe1e9ff02da1082367302b0a188a63

Sema: Don't generate runtime instructions on zirSplat if dest_ty doesn't have runtime bits


1 files changed, 8 insertions(+), 0 deletions(-)

src/Sema.zig+8
......@@ -24295,6 +24295,14 @@ fn zirSplat(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Air.I
2429524295
2429624296 if (!dest_ty.isVector(mod)) return sema.fail(block, src, "expected vector type, found '{}'", .{dest_ty.fmt(mod)});
2429724297
24298 if (!dest_ty.hasRuntimeBits(mod)) {
24299 const empty_aggregate = try mod.intern(.{ .aggregate = .{
24300 .ty = dest_ty.toIntern(),
24301 .storage = .{ .elems = &[_]InternPool.Index{} },
24302 } });
24303 return Air.internedToRef(empty_aggregate);
24304 }
24305
2429824306 const operand = try sema.resolveInst(extra.rhs);
2429924307 const scalar_ty = dest_ty.childType(mod);
2430024308 const scalar = try sema.coerce(block, scalar_ty, operand, scalar_src);