From 4bf17f0a78f0ff2732a881ca08430fb38ef13891 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20R=C3=B8nne=20Petersen?= Date: Thu, 31 Oct 2024 09:50:14 +0100 Subject: [PATCH] Air: Always return true for inline assembly in mustLower(). AstGen requires inline assembly to either have outputs or be marked volatile, so there doesn't appear to be any point in doing these checks. --- src/Air.zig | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/Air.zig b/src/Air.zig index 724b163512f4a9f385ce1c634da6c0489786ec32..9e2603c169f0cc2784ac1a3157ac198ce369b51a 100644 --- a/src/Air.zig +++ b/src/Air.zig @@ -1656,6 +1656,7 @@ pub fn mustLower(air: Air, inst: Air.Inst.Index, ip: *const InternPool) bool { const data = air.instructions.items(.data)[@intFromEnum(inst)]; return switch (air.instructions.items(.tag)[@intFromEnum(inst)]) { .arg, + .assembly, .block, .loop, .repeat, @@ -1861,14 +1862,6 @@ pub fn mustLower(air: Air, inst: Air.Inst.Index, ip: *const InternPool) bool { .work_group_id, => false, - .assembly => { - const extra = air.extraData(Air.Asm, data.ty_pl.payload); - const is_volatile = @as(u1, @truncate(extra.data.flags >> 31)) != 0; - return is_volatile or if (extra.data.outputs_len == 1) - @as(Air.Inst.Ref, @enumFromInt(air.extra[extra.end])) != .none - else - extra.data.outputs_len > 1; - }, .load => air.typeOf(data.ty_op.operand, ip).isVolatilePtrIp(ip), .slice_elem_val, .ptr_elem_val => air.typeOf(data.bin_op.lhs, ip).isVolatilePtrIp(ip), .atomic_load => switch (data.atomic_load.order) { -- 2.54.0