aboutsummaryrefslogtreecommitdiff
path: root/src/codegen/spirv.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/codegen/spirv.zig')
-rw-r--r--src/codegen/spirv.zig5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/codegen/spirv.zig b/src/codegen/spirv.zig
index 58da5539ac..87b72c6726 100644
--- a/src/codegen/spirv.zig
+++ b/src/codegen/spirv.zig
@@ -1507,6 +1507,11 @@ pub const DeclGen = struct {
}
fn genInst(self: *DeclGen, inst: Air.Inst.Index) !void {
+ // TODO: remove now-redundant isUnused calls from AIR handler functions
+ if (self.liveness.isUnused(inst) and !self.air.mustLower(inst)) {
+ return;
+ }
+
const air_tags = self.air.instructions.items(.tag);
const maybe_result_id: ?IdRef = switch (air_tags[inst]) {
// zig fmt: off