authorgravatar for alichraghi@proton.meAli Chraghi <alichraghi@proton.me> 2025-02-24 02:38:07+03:30
committergravatar for robin@voetter.nlRobin Voetter <robin@voetter.nl> 2025-02-24 19:12:38+01:00
log94af47d28c83efa3dc26ee0b47b224b823c9b333
treefa1cc35a793d91716709b4e1e4859c81c7015ba4
parent181a89e728a89495c00b09b767f579c9591cb08c
signaturebadge-check Signed by SSH key SHA256:ZS52FNyUv2WUXvO4njmVaFVO46RHojFuOrxRc4LuKzg

spirv: do not generate unnecessary forward pointer

Co-authored-by: Robin Voetter <robin@voetter.nl>

2 files changed, 4 insertions(+), 1 deletions(-)

src/codegen/spirv.zig+2
......@@ -1300,6 +1300,8 @@ const NavGen = struct {
13001300 .type = child_ty_id,
13011301 });
13021302
1303 self.ptr_types.getPtr(key).?.fwd_emitted = true;
1304
13031305 return result_id;
13041306 }
13051307
src/link/SpirV/prune_unused.zig+2-1
......@@ -39,6 +39,7 @@ fn canPrune(op: Opcode) bool {
3939 .Arithmetic,
4040 .RelationalAndLogical,
4141 .Bit,
42 .Annotation,
4243 => true,
4344 else => switch (op) {
4445 .OpFunction,
......@@ -273,7 +274,7 @@ pub fn run(parser: *BinaryModule.Parser, binary: *BinaryModule, progress: std.Pr
273274 .alive = try std.DynamicBitSetUnmanaged.initEmpty(a, info.result_id_to_code_offset.count()),
274275 };
275276
276 // Mark initial stuff as slive
277 // Mark initial stuff as alive
277278 {
278279 var it = binary.iterateInstructions();
279280 while (it.next()) |inst| {