diff options
author | Mathias Magnusson <mathias@magnusson.space> | 2025-06-02 21:55:11 +0200 |
---|---|---|
committer | Mathias Magnusson <mathias@magnusson.space> | 2025-06-02 22:01:00 +0200 |
commit | e2e77b4b06e51c7f7d3ea187defaf1ad08e513c1 (patch) | |
tree | 71879baf4d1a8db3163e599bc3b628c01b6ba942 /src/main.zig | |
parent | e18b172d3e4e31b4d50ca978a66187730f744a31 (diff) | |
download | huginn-e2e77b4b06e51c7f7d3ea187defaf1ad08e513c1.tar.gz |
remove the need for explicit discard instructions
by also considering an instruction's destination register(s) to be uses
and when cleaning up registers, also cleaning up those from previous
instructions (specifically this is the output of the last instruction if
it is not used anywhere)
Diffstat (limited to 'src/main.zig')
-rw-r--r-- | src/main.zig | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/main.zig b/src/main.zig index 15118d8..a9c77ac 100644 --- a/src/main.zig +++ b/src/main.zig @@ -62,6 +62,7 @@ pub fn main() !void { for (block.instrs) |instr| { std.debug.print(" {}\n", .{instr}); } + std.debug.print("Last use of each virtual register: {}\n", .{fmtHashMap(block.vreg_last_use)}); const elf = try codegen.create_elf(allocator, block); try output.writeAll(elf); std.debug.print("Run output:\n", .{}); |