authorgravatar for antoniospg100@gmail.comAntonio Gomes <antoniospg100@gmail.com> 2024-05-01 08:04:39-03:00
committergravatar for git@vexu.euVeikka Tuominen <git@vexu.eu> 2024-05-02 13:57:28+03:00
log5571c03a5a20a088c269f03c71631137f1ca2c3c
treeb2624233d1e6ee7d78346be0a6ccd2bf38b1b266
parentd841f84b8b68ee37ccad5ce97b71ea99d2c63c6d

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);