authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2026-08-23 15:15:48+02:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2026-09-05 14:54:31+02:00
logd732dab9b048a1c0bc9a8f8ab5c8c6bcddd1cc48
tree41b0f8f7dc6fc89f2af8fb4d8d455b461479b974
parent3dd329b8cffe15939669a1fbc8f3dd4da88be7f2
signaturebadge-check Signed by SSH key SHA256:7B/LJ7bpR1eX8aCXSr4mtd5M45VMPKcx9zY8e95b5QM

llvm: add updated issue links for targets with @prefetch crashes

Also lift the restriction for ARM which seems to work now. * https://github.com/llvm/llvm-project/issues/218236 * https://github.com/llvm/llvm-project/issues/218239

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

src/codegen/llvm/FuncGen.zig+2-11
......@@ -6542,28 +6542,19 @@ fn airPrefetch(self: *FuncGen, inst: Air.Inst.Index) Allocator.Error!Builder.Val
65426542 comptime assert(@backingInt(std.lang.PrefetchOptions.Cache.instruction) == 0);
65436543 comptime assert(@backingInt(std.lang.PrefetchOptions.Cache.data) == 1);
65446544
6545 // LLVM fails during codegen of instruction cache prefetchs for these architectures.
6546 // This is an LLVM bug as the prefetch intrinsic should be a noop if not supported
6547 // by the target.
6548 // To work around this, don't emit llvm.prefetch in this case.
6549 // See https://bugs.llvm.org/show_bug.cgi?id=21037
65506545 const zcu = self.object.zcu;
65516546 const target = zcu.getTarget();
65526547 switch (prefetch.cache) {
65536548 .instruction => switch (target.cpu.arch) {
6549 // https://github.com/llvm/llvm-project/issues/218236
65546550 .x86_64,
65556551 .x86,
6552 // https://github.com/llvm/llvm-project/issues/218239
65566553 .powerpc,
65576554 .powerpcle,
65586555 .powerpc64,
65596556 .powerpc64le,
65606557 => return .none,
6561 .arm, .armeb, .thumb, .thumbeb => {
6562 switch (prefetch.rw) {
6563 .write => return .none,
6564 else => {},
6565 }
6566 },
65676558 else => {},
65686559 },
65696560 .data => {},