Summary
Four tests/regression/ba-issues SIMD / v128 cases fail in build_regression_tests (ubuntu-22.04), all crashing with SIGILL (illegal instruction, exit -4) when the wamrc-generated .aot runs:
| issue |
expected |
observed |
| #2833 |
<0x0…>:v128 ×7, ret 0 |
ret -4 (SIGILL) |
| #270801 |
<0xffffffff00000000 …>:v128 ×7, ret 0 |
ret -4 (SIGILL) |
| #270802 |
<0xffffffff00000000 …>:v128 ×7, ret 0 |
ret -4 (SIGILL) |
| #2702 |
<0x0000070700000707 …>:v128 ×7, ret 0 |
ret -4 (SIGILL) |
Total: 106, Passed: 102, Failed: 4. Reproduction:
wamrc -o out.aot tests/regression/ba-issues/issues/issue-2833/filea12287_4.wasm
iwasm --heap-size=0 -f main out.aot # -> SIGILL
Root cause: the AOT emits AVX-512 the runner can't execute
GitHub moved the ubuntu-22.04 image onto AMD EPYC 9V74 (Genoa) VMs whose /proc/cpuinfo advertises avx avx2 fma f16c sse4_2 vaes vpclmulqdq — no avx512* flag (AVX-512 is masked off in the VM).
But wamrc's default host-targeted AOT (no --target/--cpu) selects the target with LLVMGetHostCPUName() — which classifies Genoa as an AVX-512-capable model — and leaves the feature string empty, so LLVM enables the model-implied AVX-512. The emitted .aot is full of AVX-512 (vmovdqa64 %zmm0{%k1}{z}, vporq %zmm, vpternlogd, vextracti64x4) and SIGILLs on the first one:
Program received signal SIGILL, Illegal instruction.
=> 0x40006878: vcmpordpd %xmm1,%xmm0,%k1 # opmask destination -> AVX-512 (EVEX)
The JIT/ORC target-machine setup already pairs the host CPU name with LLVMGetHostCPUFeatures() (CPUID-accurate); the AOT default path does not, so it targets the CPU model rather than the ISA actually enabled on the VM.
Pre-existing and LLVM-version-independent — reproduces identically on #4951 (LLVM 22) and current main (LLVM 18). On main it is currently masked by a separate LLVM-cache CI break (fixed in #4996); the compilation on android, ubuntu-22.04 workflow last passed on 2026-05-19 (5aebe728), matching when the image moved onto these AMD VMs.
In the default native AOT path, also query LLVMGetHostCPUFeatures() so codegen is capped at the runner's actual CPUID feature set (AVX-512 masked off), mirroring the JIT setup. Explicit --cpu / --cpu-features / --target builds are unaffected.
Verified on an EPYC 9V74 runner in my rebeckerspecialties fork: with the fix there is no AVX-512 in the emitted object, and the AOT runs to the expected …:v128 output with exit 0 — no SIGILL.
Summary
Four
tests/regression/ba-issuesSIMD /v128cases fail inbuild_regression_tests (ubuntu-22.04), all crashing withSIGILL(illegal instruction, exit-4) when thewamrc-generated.aotruns:<0x0…>:v128×7, ret 0<0xffffffff00000000 …>:v128×7, ret 0<0xffffffff00000000 …>:v128×7, ret 0<0x0000070700000707 …>:v128×7, ret 0Total: 106, Passed: 102, Failed: 4. Reproduction:Root cause: the AOT emits AVX-512 the runner can't execute
GitHub moved the ubuntu-22.04 image onto AMD EPYC 9V74 (Genoa) VMs whose
/proc/cpuinfoadvertisesavx avx2 fma f16c sse4_2 vaes vpclmulqdq— noavx512*flag (AVX-512 is masked off in the VM).But
wamrc's default host-targeted AOT (no--target/--cpu) selects the target withLLVMGetHostCPUName()— which classifies Genoa as an AVX-512-capable model — and leaves the feature string empty, so LLVM enables the model-implied AVX-512. The emitted.aotis full of AVX-512 (vmovdqa64 %zmm0{%k1}{z},vporq %zmm,vpternlogd,vextracti64x4) and SIGILLs on the first one:The JIT/ORC target-machine setup already pairs the host CPU name with
LLVMGetHostCPUFeatures()(CPUID-accurate); the AOT default path does not, so it targets the CPU model rather than the ISA actually enabled on the VM.Pre-existing and LLVM-version-independent — reproduces identically on #4951 (LLVM 22) and current
main(LLVM 18). Onmainit is currently masked by a separate LLVM-cache CI break (fixed in #4996); thecompilation on android, ubuntu-22.04workflow last passed on 2026-05-19 (5aebe728), matching when the image moved onto these AMD VMs.Fix — #4998
In the default native AOT path, also query
LLVMGetHostCPUFeatures()so codegen is capped at the runner's actual CPUID feature set (AVX-512 masked off), mirroring the JIT setup. Explicit--cpu/--cpu-features/--targetbuilds are unaffected.Verified on an EPYC 9V74 runner in my rebeckerspecialties fork: with the fix there is no AVX-512 in the emitted object, and the AOT runs to the expected
…:v128output with exit 0 — no SIGILL.