aboutsummaryrefslogtreecommitdiff
path: root/src/codegen
diff options
context:
space:
mode:
authormlugg <mlugg@mlugg.co.uk>2023-04-19 01:58:39 +0100
committermlugg <mlugg@mlugg.co.uk>2023-04-20 20:49:34 +0100
commit6f09a7041ecf328f761df60fae007c800ee1e2ec (patch)
tree4083f83a3f90e1e4725026243eb1b7bc64b3f977 /src/codegen
parente0886506531d662067ae42ade9f099ff9c940f58 (diff)
downloadzig-6f09a7041ecf328f761df60fae007c800ee1e2ec.tar.gz
zig-6f09a7041ecf328f761df60fae007c800ee1e2ec.zip
Begin integrating new liveness analysis into remaining backends
Diffstat (limited to 'src/codegen')
-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