From 032319c94257e650abc7a4743298154c218dba89 Mon Sep 17 00:00:00 2001 From: Matthew Lugg Date: Tue, 17 Mar 2026 09:22:04 +0000 Subject: [PATCH] llvm: disable loop vectorization for now https://github.com/llvm/llvm-project/issues/186922 is pretty serious for us, because it is causing the Zig compiler itself to get miscompiled in many common configurations. I don't feel comfortable trying to work around this by disabling certain CPU features, because that seems incredibly brittle. I think it's probably best we disable loop vectorization entirely until we upgrade to a version of LLVM where this bug is fixed. This will pessimise codegen in some cases, which is unfortunate, but that's preferable to miscompilations. --- src/zig_llvm.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/zig_llvm.cpp b/src/zig_llvm.cpp index 198f8ead154b1d95a12dfc5d1bd02be9d01b5a96..90e462860f666126cec781b7a5cc73b656a604d5 100644 --- a/src/zig_llvm.cpp +++ b/src/zig_llvm.cpp @@ -285,7 +285,7 @@ ZIG_EXTERN_C bool ZigLLVMTargetMachineEmitToFile(LLVMTargetMachineRef targ_machi PipelineTuningOptions pipeline_opts; pipeline_opts.LoopUnrolling = !options->is_debug; pipeline_opts.SLPVectorization = !options->is_debug; - pipeline_opts.LoopVectorization = !options->is_debug; + pipeline_opts.LoopVectorization = false; // https://github.com/llvm/llvm-project/issues/186922 pipeline_opts.LoopInterleaving = !options->is_debug; pipeline_opts.MergeFunctions = !options->is_debug; -- 2.54.0