julia
0992ca59 - x86: disable avx512bf16 in the JIT (LLVM cannot select bf16 vectors)

Commit
107 days ago
x86: disable avx512bf16 in the JIT (LLVM cannot select bf16 vectors) Our LLVM marks bf16 vector types legal when the target has avx512bf16 but has no selection patterns for them, so any vectorizable loop producing bf16 aborts the process during instruction selection: julia> bf(x::Int64) = Base.sitofp(Core.BFloat16, x) julia> [bf(i) for i in 1:8] LLVM ERROR: Cannot select: v32bf16 = insert_subvector ... [SIGABRT] The scalar call is fine; it takes the vectorizer to trigger. Ordinary package code reaches this easily -- BFloat16s.jl defines BFloat16(::Int64) as exactly that intrinsic, so `collect(BFloat16, 1:64)` crashes on any avx512bf16 host (AMD Zen 4/5, Cooper Lake, Sapphire Rapids). Fixed upstream in LLVM 19, which this branch predates: feeding the same IR to a stock llc, 18.1.3 fails and 19.1.1 is clean, and 1.13 (LLVM 20) is unaffected. Not needed on master for the same reason. This adjusts only the target string handed to LLVM, not the feature bits in jit_targets. Those bits are also what sysimage and pkgimage validation match against; clearing the bit there makes every cached image built for an avx512bf16 CPU fail to load with "Rejecting this target due to use of runtime-disabled features". Appending `-avx512bf16` is likewise required rather than merely dropping `+avx512bf16`, since the CPU name alone (e.g. `znver4`) re-enables the feature inside LLVM. Fixes #62666 on 1.12. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PH4zH9zvavbXWXomJbCq3B
Author
Committer
Parents
Loading