Skip to content

Commit b4fd57a

Browse files
jacobly0andrewrk
authored andcommitted
llvm: workaround crashes in llvm loop optimizations
Workaround for #24383
1 parent 592f104 commit b4fd57a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/codegen/llvm.zig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6385,6 +6385,9 @@ pub const FuncGen = struct {
63856385
// * https://github.com/llvm/llvm-project/blob/56905dab7da50bccfcceaeb496b206ff476127e1/llvm/test/MC/WebAssembly/blockaddress.ll
63866386
if (zcu.comp.getTarget().cpu.arch.isWasm()) break :jmp_table null;
63876387

6388+
// Workaround for https://github.com/ziglang/zig/issues/24383:
6389+
if (self.ng.ownerModule().optimize_mode == .ReleaseSafe) break :jmp_table null;
6390+
63886391
// On a 64-bit target, 1024 pointers in our jump table is about 8K of pointers. This seems just
63896392
// about acceptable - it won't fill L1d cache on most CPUs.
63906393
const max_table_len = 1024;

0 commit comments

Comments
 (0)