authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2024-10-31 09:55:31+01:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2025-05-14 05:43:57+02:00
log16b331f5fd9b5e444be031664c4794412fd2081f
treefb12c21c1c6b10c23b83ebac339ffc0094b66959
parent4bf17f0a78f0ff2732a881ca08430fb38ef13891
signaturebadge-check Signed by SSH key SHA256:7B/LJ7bpR1eX8aCXSr4mtd5M45VMPKcx9zY8e95b5QM

Air: Fix mustLower() to consider volatile for a handful of instructions.

These can all potentially operate on volatile pointers.

1 files changed, 2 insertions(+), 6 deletions(-)

src/Air.zig+2-6
...@@ -1799,12 +1799,8 @@ pub fn mustLower(air: Air, inst: Air.Inst.Index, ip: *const InternPool) bool {...@@ -1799,12 +1799,8 @@ pub fn mustLower(air: Air, inst: Air.Inst.Index, ip: *const InternPool) bool {
1799 .cmp_vector_optimized,1799 .cmp_vector_optimized,
1800 .is_null,1800 .is_null,
1801 .is_non_null,1801 .is_non_null,
1802 .is_null_ptr,
1803 .is_non_null_ptr,
1804 .is_err,1802 .is_err,
1805 .is_non_err,1803 .is_non_err,
1806 .is_err_ptr,
1807 .is_non_err_ptr,
1808 .bool_and,1804 .bool_and,
1809 .bool_or,1805 .bool_or,
1810 .fptrunc,1806 .fptrunc,
...@@ -1817,7 +1813,6 @@ pub fn mustLower(air: Air, inst: Air.Inst.Index, ip: *const InternPool) bool {...@@ -1817,7 +1813,6 @@ pub fn mustLower(air: Air, inst: Air.Inst.Index, ip: *const InternPool) bool {
1817 .unwrap_errunion_payload,1813 .unwrap_errunion_payload,
1818 .unwrap_errunion_err,1814 .unwrap_errunion_err,
1819 .unwrap_errunion_payload_ptr,1815 .unwrap_errunion_payload_ptr,
1820 .unwrap_errunion_err_ptr,
1821 .wrap_errunion_payload,1816 .wrap_errunion_payload,
1822 .wrap_errunion_err,1817 .wrap_errunion_err,
1823 .struct_field_ptr,1818 .struct_field_ptr,
...@@ -1862,7 +1857,8 @@ pub fn mustLower(air: Air, inst: Air.Inst.Index, ip: *const InternPool) bool {...@@ -1862,7 +1857,8 @@ pub fn mustLower(air: Air, inst: Air.Inst.Index, ip: *const InternPool) bool {
1862 .work_group_id,1857 .work_group_id,
1863 => false,1858 => false,
18641859
1865 .load => air.typeOf(data.ty_op.operand, ip).isVolatilePtrIp(ip),1860 .is_non_null_ptr, .is_null_ptr, .is_non_err_ptr, .is_err_ptr => air.typeOf(data.un_op, ip).isVolatilePtrIp(ip),
1861 .load, .unwrap_errunion_err_ptr => air.typeOf(data.ty_op.operand, ip).isVolatilePtrIp(ip),
1866 .slice_elem_val, .ptr_elem_val => air.typeOf(data.bin_op.lhs, ip).isVolatilePtrIp(ip),1862 .slice_elem_val, .ptr_elem_val => air.typeOf(data.bin_op.lhs, ip).isVolatilePtrIp(ip),
1867 .atomic_load => switch (data.atomic_load.order) {1863 .atomic_load => switch (data.atomic_load.order) {
1868 .unordered, .monotonic => air.typeOf(data.atomic_load.ptr, ip).isVolatilePtrIp(ip),1864 .unordered, .monotonic => air.typeOf(data.atomic_load.ptr, ip).isVolatilePtrIp(ip),