| ... | @@ -412,6 +412,9 @@ const Function = struct { | ... | @@ -412,6 +412,9 @@ const Function = struct { |
| 412 | } | 412 | } |
| 413 | | 413 | |
| 414 | fn genNot(self: *Function, inst: *ir.Inst.Not, comptime arch: std.Target.Cpu.Arch) !MCValue { | 414 | fn genNot(self: *Function, inst: *ir.Inst.Not, comptime arch: std.Target.Cpu.Arch) !MCValue { |
| | 415 | // No side effects, so if it's unreferenced, do nothing. |
| | 416 | if (inst.base.isUnused()) |
| | 417 | return MCValue.dead; |
| 415 | switch (arch) { | 418 | switch (arch) { |
| 416 | else => return self.fail(inst.base.src, "TODO implement NOT for {}", .{self.target.cpu.arch}), | 419 | else => return self.fail(inst.base.src, "TODO implement NOT for {}", .{self.target.cpu.arch}), |
| 417 | } | 420 | } |
| ... | @@ -819,6 +822,8 @@ const Function = struct { | ... | @@ -819,6 +822,8 @@ const Function = struct { |
| 819 | } | 822 | } |
| 820 | | 823 | |
| 821 | fn genAsm(self: *Function, inst: *ir.Inst.Assembly, comptime arch: Target.Cpu.Arch) !MCValue { | 824 | fn genAsm(self: *Function, inst: *ir.Inst.Assembly, comptime arch: Target.Cpu.Arch) !MCValue { |
| | 825 | if (!inst.args.is_volatile and inst.base.isUnused()) |
| | 826 | return MCValue.dead; |
| 822 | if (arch != .x86_64 and arch != .i386) { | 827 | if (arch != .x86_64 and arch != .i386) { |
| 823 | return self.fail(inst.base.src, "TODO implement inline asm support for more architectures", .{}); | 828 | return self.fail(inst.base.src, "TODO implement inline asm support for more architectures", .{}); |
| 824 | } | 829 | } |