Skip to content

Commit 43ba3a8

Browse files
kotlarmilosradekdouliklambdageek
authored
[mono] Fix LLVMArgWasmVtypeAsScalar when a method doesn't set its return value (#101299)
* Update mini-llvm.c I think we should handle it here, the same way as `LLVMArgVtypeAsScalar`. They differ only in the return type, where the wasm specific one is returning type of the element instead of `int`. * Include TrimmerRootDescriptor only on Apple mobile platforms * Update src/mono/mono/mini/mini-llvm.c --------- Co-authored-by: Radek Doulik <radek.doulik@gmail.com> Co-authored-by: Aleksey Kliger (λgeek) <akliger@gmail.com>
1 parent c028937 commit 43ba3a8

File tree

13 files changed

+30
-14
lines changed

13 files changed

+30
-14
lines changed

src/libraries/System.Configuration.ConfigurationManager/tests/System.Configuration.ConfigurationManager.Tests.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,8 @@
9797
</ItemGroup>
9898
<ItemGroup>
9999
<ProjectReference Include="..\src\System.Configuration.ConfigurationManager.csproj" />
100-
<TrimmerRootDescriptor Include="$(MSBuildThisFileDirectory)ILLink.Descriptors.xml" />
100+
<!-- Apple mobile trimming descriptor for Mono runtime -->
101+
<TrimmerRootDescriptor Condition="'$(TargetsAppleMobile)' == 'true' and '$(EnableAggressiveTrimming)' == 'true' and '$(UseNativeAotRuntime)' != 'true'" Include="$(MSBuildThisFileDirectory)ILLink.Descriptors.xml" />
101102
</ItemGroup>
102103
<ItemGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETFramework'">
103104
<Reference Include="System.Configuration" />

src/libraries/System.Data.Common/tests/System.Data.Common.Tests.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@
123123
<ItemGroup>
124124
<PackageReference Include="System.Data.Common.TestData" Version="$(SystemDataCommonTestDataVersion)" />
125125
<PackageReference Include="System.Data.SqlClient" Version="$(SystemDataSqlClientVersion)" />
126-
<TrimmerRootDescriptor Include="$(MSBuildThisFileDirectory)ILLink.Descriptors.xml" />
126+
<!-- Apple mobile trimming descriptor for Mono runtime -->
127+
<TrimmerRootDescriptor Condition="'$(TargetsAppleMobile)' == 'true' and '$(EnableAggressiveTrimming)' == 'true' and '$(UseNativeAotRuntime)' != 'true'" Include="$(MSBuildThisFileDirectory)ILLink.Descriptors.xml" />
127128
</ItemGroup>
128129
</Project>

src/libraries/System.Diagnostics.FileVersionInfo/tests/System.Diagnostics.FileVersionInfo.Tests/System.Diagnostics.FileVersionInfo.Tests.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
<!-- R2R testing does not tolerate the combination of a regular project reference and a content reference. -->
5353
<!-- This is a bug in the SDK tracked here: https://github.com/dotnet/sdk/issues/30718 -->
5454
<PublishReadyToRunExclude Include="System.Diagnostics.FileVersionInfo.TestAssembly.dll" />
55-
<TrimmerRootDescriptor Include="$(MSBuildThisFileDirectory)ILLink.Descriptors.xml" />
55+
<!-- Apple mobile trimming descriptor for Mono runtime -->
56+
<TrimmerRootDescriptor Condition="'$(TargetsAppleMobile)' == 'true' and '$(EnableAggressiveTrimming)' == 'true' and '$(UseNativeAotRuntime)' != 'true'" Include="$(MSBuildThisFileDirectory)ILLink.Descriptors.xml" />
5657
</ItemGroup>
5758
</Project>

src/libraries/System.Linq/tests/System.Linq.Tests.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
</PropertyGroup>
66
<ItemGroup>
77
<RdXmlFile Include="default.rd.xml" />
8-
<TrimmerRootDescriptor Include="$(MSBuildThisFileDirectory)ILLink.Descriptors.xml" />
8+
<!-- Apple mobile trimming descriptor for Mono runtime -->
9+
<TrimmerRootDescriptor Condition="'$(TargetsAppleMobile)' == 'true' and '$(EnableAggressiveTrimming)' == 'true' and '$(UseNativeAotRuntime)' != 'true'" Include="$(MSBuildThisFileDirectory)ILLink.Descriptors.xml" />
910
</ItemGroup>
1011
<ItemGroup>
1112
<Compile Include="AggregateTests.cs" />

src/libraries/System.Reflection.MetadataLoadContext/tests/System.Reflection.MetadataLoadContext.Tests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@
9292
<WasmFilesToIncludeFromPublishDir Include="mscorlib.dll" />
9393
</ItemGroup>
9494

95-
<ItemGroup Condition="'$(TargetOS)' == 'browser' or ('$(EnableAggressiveTrimming)' == 'true' and '$(UseNativeAotRuntime)' != 'true')">
95+
<ItemGroup Condition="'$(TargetOS)' == 'browser' or ('$(TargetsAppleMobile)' == 'true' and '$(EnableAggressiveTrimming)' == 'true' and '$(UseNativeAotRuntime)' != 'true')">
9696
<TrimmerRootDescriptor Include="$(MSBuildThisFileDirectory)ILLink.Descriptors.xml" />
9797
</ItemGroup>
9898

src/libraries/System.Resources.Extensions/tests/System.Resources.Extensions.Tests.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@
2727
<PackageReference Include="System.ValueTuple" Version="$(SystemValueTupleVersion)" />
2828
</ItemGroup>
2929
<ItemGroup>
30-
<TrimmerRootDescriptor Include="$(MSBuildThisFileDirectory)ILLink.Descriptors.xml" />
30+
<!-- Apple mobile trimming descriptor for Mono runtime -->
31+
<TrimmerRootDescriptor Condition="'$(TargetsAppleMobile)' == 'true' and '$(EnableAggressiveTrimming)' == 'true' and '$(UseNativeAotRuntime)' != 'true'" Include="$(MSBuildThisFileDirectory)ILLink.Descriptors.xml" />
3132
</ItemGroup>
3233
<!-- Use the following target to regenerate the test resources file.
3334
This is done from a test application and checked in so that we don't run

src/libraries/System.Runtime.Loader/tests/System.Runtime.Loader.Tests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
<ItemGroup Condition="'$(TargetOS)' == 'browser'">
7272
<WasmFilesToIncludeFromPublishDir Include="$(AssemblyName).dll" />
7373
</ItemGroup>
74-
<ItemGroup Condition="'$(TargetOS)' == 'browser' or ('$(EnableAggressiveTrimming)' == 'true' and '$(UseNativeAotRuntime)' != 'true')">
74+
<ItemGroup Condition="'$(TargetOS)' == 'browser' or ('$(TargetsAppleMobile)' == 'true' and '$(EnableAggressiveTrimming)' == 'true' and '$(UseNativeAotRuntime)' != 'true')">
7575
<TrimmerRootDescriptor Include="$(MSBuildThisFileDirectory)ILLink.Descriptors.xml" />
7676
</ItemGroup>
7777

src/libraries/System.Runtime/tests/System.Globalization.Tests/System.Globalization.Tests.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
</PropertyGroup>
1212
<ItemGroup>
1313
<RdXmlFile Include="default.rd.xml" />
14-
<TrimmerRootDescriptor Include="$(MSBuildThisFileDirectory)ILLink.Descriptors.xml" />
14+
<!-- Apple mobile trimming descriptor for Mono runtime -->
15+
<TrimmerRootDescriptor Condition="'$(TargetsAppleMobile)' == 'true' and '$(EnableAggressiveTrimming)' == 'true' and '$(UseNativeAotRuntime)' != 'true'" Include="$(MSBuildThisFileDirectory)ILLink.Descriptors.xml" />
1516
</ItemGroup>
1617
<ItemGroup>
1718
<Compile Include="AssemblyInfo.cs" />

src/libraries/System.Runtime/tests/System.IO.FileSystem.Tests/DisabledFileLockingTests/System.IO.FileSystem.DisabledFileLocking.Tests.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@
3434
</ItemGroup>
3535
<ItemGroup>
3636
<ProjectReference Include="$(CommonTestPath)StreamConformanceTests\StreamConformanceTests.csproj" />
37-
<TrimmerRootDescriptor Include="$(MSBuildThisFileDirectory)ILLink.Descriptors.xml" />
37+
<!-- Apple mobile trimming descriptor for Mono runtime -->
38+
<TrimmerRootDescriptor Condition="'$(TargetsAppleMobile)' == 'true' and '$(EnableAggressiveTrimming)' == 'true' and '$(UseNativeAotRuntime)' != 'true'" Include="$(MSBuildThisFileDirectory)ILLink.Descriptors.xml" />
3839
</ItemGroup>
3940
<ItemGroup>
4041
<RuntimeHostConfigurationOption Include="System.IO.DisableFileLocking" Value="true" />

src/libraries/System.Runtime/tests/System.IO.FileSystem.Tests/System.IO.FileSystem.Tests.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,7 @@
245245
</ItemGroup>
246246
<ItemGroup>
247247
<ProjectReference Include="$(CommonTestPath)StreamConformanceTests\StreamConformanceTests.csproj" />
248-
<TrimmerRootDescriptor Include="$(MSBuildThisFileDirectory)ILLink.Descriptors.xml" />
248+
<!-- Apple mobile trimming descriptor for Mono runtime -->
249+
<TrimmerRootDescriptor Condition="'$(TargetsAppleMobile)' == 'true' and '$(EnableAggressiveTrimming)' == 'true' and '$(UseNativeAotRuntime)' != 'true'" Include="$(MSBuildThisFileDirectory)ILLink.Descriptors.xml" />
249250
</ItemGroup>
250251
</Project>

src/libraries/System.Security.Cryptography.Xml/tests/System.Security.Cryptography.Xml.Tests.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@
7575
<Reference Include="System.Security" />
7676
</ItemGroup>
7777
<ItemGroup>
78-
<TrimmerRootDescriptor Include="$(MSBuildThisFileDirectory)ILLink.Descriptors.xml" />
78+
<!-- Apple mobile trimming descriptor for Mono runtime -->
79+
<TrimmerRootDescriptor Condition="'$(TargetsAppleMobile)' == 'true' and '$(EnableAggressiveTrimming)' == 'true' and '$(UseNativeAotRuntime)' != 'true'" Include="$(MSBuildThisFileDirectory)ILLink.Descriptors.xml" />
7980
</ItemGroup>
8081
</Project>

src/libraries/System.Text.Json/tests/System.Text.Json.Tests/System.Text.Json.Tests.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,7 @@
307307
<Reference Include="Microsoft.CSharp" />
308308
</ItemGroup>
309309
<ItemGroup>
310-
<TrimmerRootDescriptor Include="$(MSBuildThisFileDirectory)ILLink.Descriptors.xml" />
310+
<!-- Apple mobile trimming descriptor for Mono runtime -->
311+
<TrimmerRootDescriptor Condition="'$(TargetsAppleMobile)' == 'true' and '$(EnableAggressiveTrimming)' == 'true' and '$(UseNativeAotRuntime)' != 'true'" Include="$(MSBuildThisFileDirectory)ILLink.Descriptors.xml" />
311312
</ItemGroup>
312313
</Project>

src/mono/mono/mini/mini-llvm.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6119,8 +6119,14 @@ process_bb (EmitContext *ctx, MonoBasicBlock *bb)
61196119
gboolean src_in_reg = FALSE;
61206120
gboolean is_simd = mini_class_is_simd (ctx->cfg, mono_class_from_mono_type_internal (sig->ret));
61216121
switch (linfo->ret.storage) {
6122-
case LLVMArgNormal: src_in_reg = TRUE; break;
6123-
case LLVMArgVtypeInReg: case LLVMArgVtypeAsScalar: src_in_reg = is_simd; break;
6122+
case LLVMArgNormal:
6123+
src_in_reg = TRUE;
6124+
break;
6125+
case LLVMArgVtypeInReg:
6126+
case LLVMArgVtypeAsScalar:
6127+
case LLVMArgWasmVtypeAsScalar:
6128+
src_in_reg = is_simd;
6129+
break;
61246130
}
61256131
if (src_in_reg && (!lhs || ctx->is_dead [ins->sreg1])) {
61266132
/*

0 commit comments

Comments
 (0)