authorgravatar for mlugg@mlugg.co.ukMatthew Lugg <mlugg@mlugg.co.uk> 2026-03-17 19:37:50+00:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2026-03-18 01:02:29+01:00
log0a2f6632810ceb6a17bffbafd846c5f3aaa24e64
tree66f549c2b60c9de8cf615ccb14525ccc8948ad26
parent6ae30662dc04d46165bb6c2481d1ee1d0cc60717

llvm: solve a misc TODO

The compiler has had the desired semantics for comptime evaluation of these checks for quite a while now.

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

src/codegen/llvm.zig+2-3
......@@ -10833,9 +10833,8 @@ pub const FuncGen = struct {
1083310833 comptime assert(@intFromEnum(std.builtin.PrefetchOptions.Rw.read) == 0);
1083410834 comptime assert(@intFromEnum(std.builtin.PrefetchOptions.Rw.write) == 1);
1083510835
10836 // TODO these two asserts should be able to be comptime because the type is a u2
10837 assert(prefetch.locality >= 0);
10838 assert(prefetch.locality <= 3);
10836 comptime assert(prefetch.locality >= 0);
10837 comptime assert(prefetch.locality <= 3);
1083910838
1084010839 comptime assert(@intFromEnum(std.builtin.PrefetchOptions.Cache.instruction) == 0);
1084110840 comptime assert(@intFromEnum(std.builtin.PrefetchOptions.Cache.data) == 1);