Skip to content

[tests] Re-enable LLVM AOT for the 'dont link' tests once the mono uaddlp/saddlp intrinsic fix flows in #26467

Description

@rolfbjarne

Context

Mono's LLVM AOT compiler emits a malformed declaration for the uaddlp/saddlp intrinsics:

declare <8 x i8> @llvm.aarch64.neon.uaddlp.v8i8.f64(double)
declare <8 x i8> @llvm.aarch64.neon.saddlp.v8i8.f64(double)

LLVM 23's IR verifier rejects these, so AOT compilation of System.Private.CoreLib.dll fails:

error : Failed to AOT compile System.Private.CoreLib.dll, the AOT compiler exited with code 1.

with:

intrinsic argument 0 type (overload type 1) expected any vector type, but got double
declare <8 x i8> @llvm.aarch64.neon.uaddlp.v8i8.f64(double)
LLVM ERROR: Broken module found, compilation aborted!

This started with the dotnet/dotnet bump from 11.0.0-preview.7.26365.101 to 11.0.0-rc.1.26411.119, which brought LLVM 23 into Microsoft.NETCore.App.Runtime.AOT.*.Cross.* (the .NET 10 pack ships LLVM 19, so .NET 10 is unaffected).

Only the dont link tests are affected: the only methods referencing those intrinsics are the bodies of AdvSimd.AddPairwiseWidening themselves, and those are removed by the trimmer in every other configuration.

Reproduces with:

make clean build run -C "tests/linker/dont link/dotnet/iOS" TEST_VARIATION='prepare-assemblies|monovm|dynamic-registrar|release' CONFIG=Release

The workaround to remove

tests/linker/dont link/dotnet/shared.csproj sets:

<!--
  Mono's LLVM AOT compiler emits a malformed declaration for the uaddlp/saddlp intrinsics,
  which LLVM 23's IR verifier rejects, so AOT compilation of System.Private.CoreLib fails.
  This only affects us here, because the methods that reference those intrinsics
  (AdvSimd.AddPairwiseWidening) survive only when the trimmer is disabled.
  Remove once https://github.com/dotnet/runtime/issues/132743 has been fixed.
-->
<MtouchUseLlvm>false</MtouchUseLlvm>

What to do

Once dotnet/runtime#132744 has flowed into our dependencies, remove that MtouchUseLlvm property (and its comment) again, so the dont link tests keep exercising the LLVM AOT compiler in Release.

Verify with:

make clean build run -C "tests/linker/dont link/dotnet/iOS" TEST_VARIATION='prepare-assemblies|monovm|dynamic-registrar|release' CONFIG=Release

Links

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions