spirv: do not generate unnecessary forward pointer

Co-authored-by: Robin Voetter <robin@voetter.nl>
This commit is contained in:
Ali Cheraghi
2025-02-24 02:38:07 +03:30
committed by Robin Voetter
parent 181a89e728
commit 94af47d28c
2 changed files with 4 additions and 1 deletions

View File

@@ -1300,6 +1300,8 @@ const NavGen = struct {
.type = child_ty_id,
});
self.ptr_types.getPtr(key).?.fwd_emitted = true;
return result_id;
}

View File

@@ -39,6 +39,7 @@ fn canPrune(op: Opcode) bool {
.Arithmetic,
.RelationalAndLogical,
.Bit,
.Annotation,
=> true,
else => switch (op) {
.OpFunction,
@@ -273,7 +274,7 @@ pub fn run(parser: *BinaryModule.Parser, binary: *BinaryModule, progress: std.Pr
.alive = try std.DynamicBitSetUnmanaged.initEmpty(a, info.result_id_to_code_offset.count()),
};
// Mark initial stuff as slive
// Mark initial stuff as alive
{
var it = binary.iterateInstructions();
while (it.next()) |inst| {