dotnet / dotnet/macios

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

Open Beginner friendly
#26,467 0 comments 0 reactions 0 assignees View on GitHub
copilot
Dominant language
C#
Stars
2.9k
Forks
576
Avg merge
2d 13h
Merged PRs (30d)
96

Description

### Context

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

```llvm
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:

```shell
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:

```xml

false
```

### What to do

Once https://github.com/dotnet/runtime/pull/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:

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

### Links

* Runtime issue: https://github.com/dotnet/runtime/issues/132743
* Runtime fix: https://github.com/dotnet/runtime/pull/132744

Contributor guide

No contributing guide indexed for this repository

Research direction

After https://github.com/dotnet/runtime/pull/132744 has flowed into the dependencies, inspect tests/linker/dont link/dotnet/shared.csproj and remove the documented MtouchUseLlvm workaround. Run the provided make clean build run command in tests/linker/dont link/dotnet/iOS with the listed TEST_VARIATION and Release configuration; done means the dont link tests pass with LLVM AOT enabled.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
build-system, testing
Issue type
Refactor
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.