Ivan Povazan [Fri, 24 Feb 2023 16:42:55 +0000 (17:42 +0100)]
Adding HelloiOS sample for NativeAOT (#82249)
- The application is intended to be used by developers who work on enabling NativeAOT on iOS-like platforms and can serve as PoC
- Currently still relies on dotnet/runtime internals and requires local builds instead of package references
Marie Píchová [Fri, 24 Feb 2023 15:17:09 +0000 (16:17 +0100)]
[HTTP/3] Attempt at using newer image to allow H/3 Windows stress (#82226)
* Attempt at using newer image to allow H/3 Windows stress
* Failing docker experiments
* Removed testing print
Adeel Mujahid [Fri, 24 Feb 2023 15:02:08 +0000 (17:02 +0200)]
Fix ilc package name for linux-musl (#82590)
Alexander Köplinger [Fri, 24 Feb 2023 14:57:07 +0000 (15:57 +0100)]
Fix warning/error with gcc11 in PalRedhawkUnix.cpp (#82596)
Otherwise you get:
```
error: ignoring return value of ‘ssize_t write(int, const void*, std::size_t)’ declared with attribute ‘warn_unused_result’ [-Werror=unused-result]
681 | write(STDERR_FILENO, message, strlen(message));
| ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
The same warning was already fixed for `alloca()` in encee.cpp as part of https://github.com/dotnet/runtime/commit/
5d6d55977270b3d1549a5c2e454b191487bef5eb#diff-f1018f796e7e06f60f7f4558583ec116f8e394bc90e29177c9dbdbfd29b78ab5R670, applying the same fix here
Kunal Pathak [Fri, 24 Feb 2023 14:45:55 +0000 (06:45 -0800)]
Let GenTreeCopyOrReload handle scenarios when FEATURE_MULTIREG_RET is disabled (#82451)
* remove FEATURE_MULTIREG_RET check
* Remove comments
* updated comment
Ilona Tomkowicz [Fri, 24 Feb 2023 12:59:32 +0000 (13:59 +0100)]
[wasm][icu] ICU files sharding + custom icu data loading for WASM (#80421)
* User can set `GlobalizationShard`.
* Sample for sharding, might be transformed into a test.
* Option of custom shard file upload.
* Replaced sample with WBT.
* Remove unnecessary change.
* Fixed invariantMode + full custom path + nit.
* Draft of documentation.
* Rename to reflect usage better.
* Fix full path file loading to the Browser.
* Fixed WBT build errors.
* Docs: only one ICU file can be used.
* Fixed NodeJs: `navigator` is not defined.
* Paritial fix of sharding tests.
* RuntimePack can differ for AOT and Release.
* Fix `ja-JP` culture not found in CheckDateTimeLocale.
* Fixedculture not found in SatelliteAssemblyTests.
* Fixed culture not found in System.Runtime tests.
* `icudt.dat` should not be loaded when <IcuFileName> empty + EFIGS contains only some specific locales + `IsIcuFilePredefined` is not necessary.
* Improved doc readability using @radical's suggestions.
* Forgot to remove comments.
* Missing change for
5df3c9ccc851c45fbdbc3acfd96162c3237973c1.
* WBT: Applied review.
* Applied @pavelsavara's suggestion.
* Added `WasmIncludeFullIcuData` to work like Blazor.
* Another missing change for
5df3c9ccc851c45fbdbc3acfd96162c3237973c1.
* Missing change for
b5a1308372ed00f1dea08dadd647e97dffe57e27.
* Fix debugger failures for real, previous flag was in the wrong place.
* Fixed most libraries that require full ICU.
* WBT should load full icu only when invariant off.
* Applied @radical's idea.
* Missing change for the last commit.
* Build args should not be edited inside of `BuildProject()` + Identity on a property does not exist.
* One flag for all lib tests instead of multiple changes.
* Revert comments for the prev commit.
* Fix for trimming tests.
* Rename + throwing when file not found.
* Fixed NoopNativeRebuildTest WBT.
* Forgotten logging.
* Tests with custom shard.
* Added more complex tests.
* Should fix wasm tests on helix.
* Fix WBT.
* [wasm] Update eng/testing/scenarios/BuildWasmAppsJobsList.txt
* [wasm] fix testassets path
* Default mode for tests should be the same as default mode for template apps.
* Checking preferred icu when assets are still not populated was incorrect.
* DataTimeFormat does not work well for browser + wrong condition.
* Removed empty space changes.
* WBT for automatic icu selection based on locale.
* Moved the full icu flag from libs to lib tests.
* Flag in tests.wasm.targets should be enough for trimming tests.
* Debugger tests in default globalization mode unless CJK needed. Firefox does not respect UILocale.
* Removing forgotten comment.
* Fixed sharding wbt.
* This should not be commented out.
* Sharding WBT do not make sense on v8 + fixed debugger tests on Linux + fixed WBT on Chrome on Windows.
* Fix test to have sense.
* Fixed tests to reflect expected behavior after removing predefinedCulturesOnly=true from WASM + added en-US to custom ICU.
* Fixed merge errors, removed redundant comment.
* Update docs, disable NodeJS in tests.
* @radical's review part 1: embedded comments.
* Test clean-up by @radical.
* Fix arg order in debugger + revert wasi sharding.
---------
Co-authored-by: Ankit Jain <radical@gmail.com>
Katelyn Gadd [Fri, 24 Feb 2023 12:14:30 +0000 (04:14 -0800)]
[wasm] Migrate jiterpreter LDELEMA1 and LDLEN from C helper to inline in traces (#82576)
Inline ldelema1 and ldlen operations into traces instead of using a C helper, which should mitigate the regressions we saw in array-heavy benchmarks once turning on the jiterpreter
Clean up some correctness issues with null check optimization
Improve diagnostics and clean up some comments
Pavel Savara [Fri, 24 Feb 2023 11:51:46 +0000 (12:51 +0100)]
- remove custom startup sequence of blazor (#82532)
- remove legacy mono_load_runtime_and_bcl_args
- unused MonoConfigError removal
Egor Bogatov [Fri, 24 Feb 2023 11:27:06 +0000 (12:27 +0100)]
Enable constant folding in Tier0 (#82412)
Tlakaelel Axayakatl Ceja [Fri, 24 Feb 2023 09:01:57 +0000 (01:01 -0800)]
Fix missing changes in from ProducedBy enum change (#82575)
Egor Bogatov [Fri, 24 Feb 2023 08:48:24 +0000 (09:48 +0100)]
Fix rva[cns] folding (#81854)
Katelyn Gadd [Fri, 24 Feb 2023 06:56:27 +0000 (22:56 -0800)]
[wasm] Disable jiterpreter null check optimization for mid-method traces (#82585)
* Disable null check optimization when starting mid-method since we don't know which locals have had their address taken
* Improve null check optimization diagnostics
Steve Pfister [Fri, 24 Feb 2023 03:17:51 +0000 (19:17 -0800)]
[workloads] Bump net7 package version (#82270)
shin1m [Fri, 24 Feb 2023 00:21:41 +0000 (09:21 +0900)]
Fixed the 3rd argument for TypedArray.fill(). (#82480)
`TypedArray.fill()` expects `end` as the 3rd argument.
Thays Grazia [Fri, 24 Feb 2023 00:17:29 +0000 (21:17 -0300)]
[mono][debugger] Support symbol server on mobile devices (#82555)
* implementing support to symbol server on mobile devices
* Implementing support to symbol_server on mobile
* fix compilation
* keeping the \n
* keeping \n
* Fix command id
* fix id
dotnet-maestro[bot] [Fri, 24 Feb 2023 00:17:18 +0000 (16:17 -0800)]
[main] Update dependencies from dotnet/llvm-project (#82545)
* Update dependencies from https://github.com/dotnet/llvm-project build
20230222.2
runtime.linux-arm64.Microsoft.NETCore.Runtime.JIT.Tools , runtime.linux-arm64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.linux-arm64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools , runtime.linux-arm64.Microsoft.NETCore.Runtime.ObjWriter , runtime.linux-musl-arm64.Microsoft.NETCore.Runtime.JIT.Tools , runtime.linux-musl-arm64.Microsoft.NETCore.Runtime.ObjWriter , runtime.linux-musl-x64.Microsoft.NETCore.Runtime.JIT.Tools , runtime.linux-musl-x64.Microsoft.NETCore.Runtime.ObjWriter , runtime.linux-x64.Microsoft.NETCore.Runtime.JIT.Tools , runtime.linux-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.linux-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools , runtime.linux-x64.Microsoft.NETCore.Runtime.ObjWriter , runtime.osx-arm64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.osx-arm64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools , runtime.osx-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.osx-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools , runtime.win-arm64.Microsoft.NETCore.Runtime.JIT.Tools , runtime.win-arm64.Microsoft.NETCore.Runtime.ObjWriter , runtime.win-x64.Microsoft.NETCore.Runtime.JIT.Tools , runtime.win-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.win-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools , runtime.win-x64.Microsoft.NETCore.Runtime.ObjWriter
From Version 14.0.0-alpha.1.23114.1 -> To Version 14.0.0-alpha.1.23122.2
* Fix warning detection and adjust limits for current changes
---------
Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Andy Gocke <andy@commentout.net>
Jeremy Koritzinsky [Fri, 24 Feb 2023 00:15:03 +0000 (16:15 -0800)]
Add support for dumping native stacks with cdb (#82189)
Co-authored-by: Dan Moseley <danmose@microsoft.com>
Filip Navara [Thu, 23 Feb 2023 23:45:44 +0000 (00:45 +0100)]
Add osx-arm64 to official RIDs in ILCompiler NuGet (#82558)
Egor Bogatov [Thu, 23 Feb 2023 23:37:50 +0000 (00:37 +0100)]
Add RCPC ISA detection on win-arm64 (#82527)
* Add RCPC ISA detection on win-arm64
* Address feedback
Ankit Jain [Thu, 23 Feb 2023 23:36:37 +0000 (18:36 -0500)]
[wasi] Add `wasi-experimental` workload, `wasiconsole` template, and `Wasi.Build.Tests` (#81849)
* EmitWasmBundleObjectFile: Capture any clang output/errors
* [wasi] Add wasiconsole template
* [wasi] Add wasmtime support for WasmAppHost
* [wasi] Add wasi-experimental workload
- And Microsoft.NET.Runtime.WebAssembly.Wasi.Sdk
* [wasi] Add Wasi.Build.Tests
* [wasi] cleanup
* [wasi] liveBuilds.targets - add dotnet.wasm, and other files
* Add CI support for Wasi.Build.Tests
* fix build
* Link required libc++*.a from wasi-sdk
* Address earlier review feedback from @pavelsavara
Steve Pfister [Thu, 23 Feb 2023 23:30:27 +0000 (15:30 -0800)]
[workload] Upstream net7 manifest json and targets (#82267)
The upstream version did not contain arm64 changes.
Stephen Toub [Thu, 23 Feb 2023 23:00:59 +0000 (18:00 -0500)]
Return singleton enumerators from IEnumerable.GetEnumerator for empty collections (#82499)
* Return singleton enumerators from IEnumerable.GetEnumerator for empty collections
Change the `IEnumerable<T>.GetEnumerator()` implementations on our core collection types to special-case Count==0 in order to return a single enumerator instead of allocating one a new each time. This saves an allocation when enumerating these collections via the interface in exchange for an extra length check as part of GetEnumerator.
* Address PR feedback
- Create helper function for empty enumerator
- Add tests for singletons
* Fix a few tests
Stephen Toub [Thu, 23 Feb 2023 23:00:41 +0000 (18:00 -0500)]
Use throw helpers in a few more places (#82533)
* Use throw helpers in a few more places
* Update src/libraries/System.Private.CoreLib/src/System/String.cs
* Add missing cast
Jeremy Koritzinsky [Thu, 23 Feb 2023 22:49:18 +0000 (14:49 -0800)]
Refactor common variables used for the "send runtime tests to helix" steps into a shared template that all of our pipelines that run runtime tests can use. (#81926)
Will Smith [Thu, 23 Feb 2023 22:21:59 +0000 (14:21 -0800)]
[JIT] On importing a CEE_INITOBJ for a simd, construct a VecCon(0) (#81982)
* On importing a CEE_INITOBJ for a simd, construct a VecCon(0) of that type
* Formatting
* Check layout to determine if type is a SIMD to avoid redundant impNormStructType call
* Fix assert
* Remove assert
* Update src/coreclr/jit/importer.cpp
Co-authored-by: SingleAccretion <62474226+SingleAccretion@users.noreply.github.com>
* Update importer.cpp
---------
Co-authored-by: SingleAccretion <62474226+SingleAccretion@users.noreply.github.com>
Will Smith [Thu, 23 Feb 2023 22:08:57 +0000 (14:08 -0800)]
[JIT] Always transform `AND(X, CNS(-1))` to `X` (#82276)
* Always skip emitting 'and reg0, -1' on x86
* Formatting
* Wrapping AreUpper32BitsZero and AreUpper32BitsSignExtended to be 64-bit only
* Added TryLowerAndNegativeOne
* minor tweak
* Update lowerxarch.cpp
* Remove peephole in favor of lowering opt
* Feedback and moved 'TryLowerAndNegativeOne' to lower.cpp
Stephen Toub [Thu, 23 Feb 2023 22:03:01 +0000 (17:03 -0500)]
Remove unnecessary _version++ from a few places (#82500)
* Remove unnecessarion _version++ from a few places
In some collection types, resizing the backing store can affect in-flight enumerations, e.g. growing a queue will cause the implementation to relayout the elements contiguously from the beginning, which will invalidate indices stored in enumerators. But for `List<T>` and `Stack<T>`, changing the backing array doesn't impact the index stored in an enumerator, nor does it impact what the enumerator will enumerate, so these operations needn't invalidate the enumerators. `List<T>`'s `set_Capacity` and `TrimExcess` already didn't update the version, but its `EnsureCapacity` did, and `Stack<T>`'s `TrimExcess` and `EnsureCapacity` both updated the version. This change just removes those unnecessary increments.
* Add a Stack.TrimExcess test
Tlakaelel Axayakatl Ceja [Thu, 23 Feb 2023 21:38:39 +0000 (13:38 -0800)]
Rename ProduceBy enum to Tool (#82550)
Tanner Gooding [Thu, 23 Feb 2023 21:36:16 +0000 (13:36 -0800)]
Don't spend cycles zeroing constrainedResolvedToken each iteration (#82531)
Tlakaelel Axayakatl Ceja [Thu, 23 Feb 2023 21:32:42 +0000 (13:32 -0800)]
Add Microsoft.NET.ILLink package (#82407)
Add is Packable property to produce the lib part of illink
Add Target to produce the ref part of illink
Add compatibility suppressions file for now, til the actual warnings are fixed
Stephen Toub [Thu, 23 Feb 2023 20:54:44 +0000 (15:54 -0500)]
Use asynchronous lock in Parallel.ForEachAsync with synchronous enumerable (#82501)
* Use asynchronous lock in Parallel.ForEachAsync with synchronous enumerable
Avoid blocking threads while waiting for access to the enumerator in the case of a slower MoveNext.
* Update src/libraries/System.Threading.Tasks.Parallel/src/System/Threading/Tasks/Parallel.ForEachAsync.cs
Co-authored-by: Tanner Gooding <tagoo@outlook.com>
---------
Co-authored-by: Tanner Gooding <tagoo@outlook.com>
Stephen Toub [Thu, 23 Feb 2023 20:54:08 +0000 (15:54 -0500)]
Replace some use of string.CompareOrdinal with string == (#82438)
* Replace some use of string.CompareOrdinal with string ==
* Update src/libraries/System.Private.CoreLib/src/System/Globalization/CalendarData.Icu.cs
Andy Ayers [Thu, 23 Feb 2023 20:49:44 +0000 (12:49 -0800)]
JIT: don't optimize calls to CORINFO_HELP_VIRTUAL_FUNC_PTR for interface class lookups (#82209)
The jit currently replaces calls to `CORINFO_HELP_VIRTUAL_FUNC_PTR`
whose results are unused with null pointer checks.
But for interface classes this helper can throw a variety of exceptions, so this
optimization is incorrect.
Fixes #82127.
Parker Bibus [Thu, 23 Feb 2023 20:33:50 +0000 (12:33 -0800)]
[PERF] Fix perf pipeline runs from variable error (#82553)
* Setup testing.
* Update variable insertion.
* Revert "Setup testing."
This reverts commit
252865d57ee376d338c9940f2ea53bf3384c74d8.
Eirik Tsarpalis [Thu, 23 Feb 2023 19:48:23 +0000 (19:48 +0000)]
Avoid locking on every ValidationAttributeStore lookup. (#82536)
Eirik Tsarpalis [Thu, 23 Feb 2023 18:59:11 +0000 (18:59 +0000)]
Add new System.ComponentModel.DataAnnotations features (#82311)
* Add RangeAttribute.Minimum/MaximumIsExclusive properties.
* Add RequiredAttribute.DisallowAllDefaultValues.
* Add LengthAttribute implementation & tests.
* Add AllowedValuesAttribute & DeniedValuesAttribute
* Add Base64StringAttribute.
* Address feedback
* Address feedback.
* Reinstate culture-insensitive parsing
Adeel Mujahid [Thu, 23 Feb 2023 18:57:12 +0000 (20:57 +0200)]
Run check before generating the config file (#82435)
Tlakaelel Axayakatl Ceja [Thu, 23 Feb 2023 18:44:50 +0000 (10:44 -0800)]
Update ILLink wording (#82050)
Update linker wording to disambiguate the term from native linker, switched to illink
Deleted illink steps-explained document since is no longer accurate
This change did not change attribute justification messages
Add changes to use same wording between shared files
Johan Lorensson [Thu, 23 Feb 2023 17:11:23 +0000 (18:11 +0100)]
[Mono]: Add support for lazy runtime init in native-to-managed wrapper, similar to NativeAOT library build. (#82253)
* Add support for runtime init in native-to-managed wrapper.
NativeAOT supports library mode, building all needed runtime and
managed code into a static or shared library that can be loaded
and used by embedding applications. NativeAOT exports managed
functiond marked with UnmanagedCallersOnly attribute that can be
called by embedder to run managed code. NativeAOT runtime doesn't
need any initialization, meaning that calling the managed method
exported using UnmanagedCallersOnly attribute
will perform lazy runtime initialization on first call.
This commit add similar support to MonoVM giving it possibilities
to include a call to a runtime init function as part of
native-to-managed wrapper used for methods marked with
UnmanagedCallersOnly attribute + entry point. AOT compiler
accepts a new argument, runtime-init-callback, if used like
that, the native-to-managed wrapper will get a call to a default
invoke callback method implemented by runtime, that will call a
set callback once (thread safe). It is also possible to pass
runtime-init-callback=<custom symbol> to AOT compiler, and
in that case native-to-managed wrapper will call that function and its
up to implementor to do a thread safe implementation of runtime init.
This capability could be used in case where the library can't set the
callback before consumer of the library class the exported function.
Two new runtime API's have been added in this commit, one to set
the callback called by default runtime init implementation and the
other is the implementation of that function used in native-to-managed
wrapper if user doesn't use a custom runtime init callback function.
Since this integration scenario is mainly for library build scenarios
(we control the library builder), these methods are marked as
MONO_COMPONENT_API and not something that should be part of the public
API surface.
* Split mono_marshal_get_managed_wrapper into two functions.
* Drop runtime init for mono_marshal_emit_managed_wrapper.
* aquire/release semantics around runtime_init_callback.
* Detect MONO_JIT_ICALL_mono_dummy_runtime_init_callback in more places.
* Add description of new AOT compiler options.
Meri Khamoyan [Thu, 23 Feb 2023 16:54:12 +0000 (20:54 +0400)]
Wasi icu loading (#82444)
Added icu loading in WASI
Tanner Gooding [Thu, 23 Feb 2023 16:47:22 +0000 (08:47 -0800)]
Adding more SIMD constant folding support (#82190)
* Adding more SIMD constant folding support
* Adding tests for the new SIMD constant folding paths
* Ensure bitcasting float/double is using well-defined behavior
Tlakaelel Axayakatl Ceja [Thu, 23 Feb 2023 15:58:55 +0000 (07:58 -0800)]
Port remaining AOT tests (#82509)
* Move GenericParameter testing from NativeAOT to illink
Add Kept By in order to account for illink behavior differences
* Fix test for illink and analyzer
Revert changes to the sln which break build from VS
---------
Co-authored-by: Tlakollo <tlcejava@microsoft.com>
Co-authored-by: vitek-karas <10670590+vitek-karas@users.noreply.github.com>
Jakob Botsch Nielsen [Thu, 23 Feb 2023 13:13:43 +0000 (14:13 +0100)]
JIT: Lift remaining cmov restrictions by introducing GT_SELECTCC (#82235)
This introduces GT_SELECTCC and unifies its handling with GT_JCC. We no longer
use containment for GT_SELECT conditions in the xarch backend.
Additionally teaches liveness DCE about GT_SETCC and GT_SELECTCC by allowing it
to remove GTF_SET_FLAGS from the previous node when they are unused.
Minor diffs expected; the additional cases are really not that common. The main
benefit is that GT_SELECT is now fully on par with GT_JTRUE, and does not have
any odd limitations. The code to handle conditions is completely shared.
Filip Navara [Thu, 23 Feb 2023 11:55:45 +0000 (12:55 +0100)]
Fix passing Mac Catalyst -target flag to .mm builds (#82292)
Adeel Mujahid [Thu, 23 Feb 2023 11:26:43 +0000 (13:26 +0200)]
Fix build with old gcc (#82513)
Juan Hoyos [Thu, 23 Feb 2023 10:02:22 +0000 (02:02 -0800)]
Fix JIT pipeline issues with instantiation (#82512)
Alexander Köplinger [Thu, 23 Feb 2023 09:50:06 +0000 (10:50 +0100)]
Replace RichNav with Code Index (#82088)
RichNav is now known as Code Index: https://dev.azure.com/devdiv/DevDiv/_wiki/wikis/DevDiv.wiki/28554/Index-Your-Repo
The separate AzDO feed in nuget.config is not needed anymore which should make restore a bit faster.
Note that there's currently an error due to new MSBuild binlog version which is tracked by https://dev.azure.com/devdiv/DevDiv/_workitems/edit/1746670/, so we decided to disable the pipeline for now.
Katelyn Gadd [Thu, 23 Feb 2023 04:26:35 +0000 (20:26 -0800)]
[jiterp] Fix stelem_ref not doing a type check (#82507)
Jiterpreter's implementation of stelem_ref wasn't doing a type check, now it does (via a C helper)
Maoni Stephens [Thu, 23 Feb 2023 04:22:59 +0000 (20:22 -0800)]
Annotation changes only (part 2) (#82388)
+ change the per heap/global fields to their detailed categories
+ fixed incorrect comments for fields like full_gc_approach_event
+ moved some fields are only used for segments under #ifndef USE_REGIONS
+fixed some fields that were mistakenly marked as methods from my last annotation PR (I forgot that some fields' declarations have '(' in them so my parser treated them as methods, eg, VOLATILE(size_t) n_eph_soh)
+ got rid of useless comments for these fields
+ got rid of useless fields
Adeel Mujahid [Thu, 23 Feb 2023 04:15:17 +0000 (06:15 +0200)]
Deduplicate platform lists in BuildIntegration (#82395)
* Deduplicate platform lists in BuildIntegration
* Use exact matches in switch expression
* Treat linux-musl as linux like before
Katelyn Gadd [Thu, 23 Feb 2023 03:18:50 +0000 (19:18 -0800)]
Don't run non-wasm test lanes for jiterpreter-only changes (#82510)
Don't run non-wasm lanes for jiterpreter-only changes. The C files are guarded with HOST_BROWSER
Zoltan Varga [Thu, 23 Feb 2023 03:18:22 +0000 (22:18 -0500)]
[mono][jit] Refactor SIMD type detection. (#82419)
* [mono][jit] Refactor SIMD type detection.
Add a mini_get_simd_type_info () function to return the element type/number of elements for SIMD types.
Use it to simplify a bunch of code.
* Remove unused mono_simd_simplify_indirection () function.
* Remove Vector2 and Vector3 code, its unused and incorrect.
Elinor Fung [Thu, 23 Feb 2023 01:44:03 +0000 (17:44 -0800)]
Proposed host runtime delegate for loading an assembly (#82138)
Doc for proposed hosting API for loading an assembly - two new delegate types:
- `hdt_load_assembly`: load assembly from path
- `hdt_load_assembly_bytes`: load assembly from byte array
Eric Erhardt [Wed, 22 Feb 2023 20:28:11 +0000 (14:28 -0600)]
Refactor Logging.Console configure options (#82254)
- Use nameof instead hard-coded strings
- Move the configuration binding code to the options class. This allows the configure method to be virtual and only need a single ConsoleFormatterOptions class.
- Minor cleanup
Milos Kotlar [Wed, 22 Feb 2023 19:49:09 +0000 (20:49 +0100)]
Remove unused skip flag (#82471)
Juan Hoyos [Wed, 22 Feb 2023 18:45:18 +0000 (10:45 -0800)]
Revert update dependencies from dotnet/roslyn (#82466)
Reverts version bump component of #81164
This PR caused heavy managed build regressions hitting all PR builds. See #82458 and #76454
Bruce Forstall [Wed, 22 Feb 2023 18:44:23 +0000 (11:44 -0700)]
Fix loop hoisting float var profitability calculation (#82352)
Treat SIMD as float vars.
Bruce Forstall [Wed, 22 Feb 2023 18:43:09 +0000 (11:43 -0700)]
Fix issues with EH in unexecuted loops (#82329)
Fix two problems with code in loops that are determined to not execute
that have exception handling clauses:
1. Be more specific in loop unrolling to avoid unrolling even zero-count
loops (which causes the loop to be removed) if there is a block in the
loop with a different handler region than the handler region of the "top"
block. This should only kick in for x86, where handlers are not extracted
as funclets.
2. In Value Numbering, before actually value numbering nodes,
`optComputeLoopSideEffectsOfBlock()` walks all the blocks of all top-level
loops collecting data. Unfortunately, it sets the Value Number of certain
nodes as a way to pass information "up the tree" during processing. Presumably
these "fake" value numbers actually get replaced during actual value numbering
for the tree. However, when we go to actually value number the IR, we only
walk reachable blocks. Thus, in some cases, we would end up with a top-level
"fake" value number on an unreachable statement root, thus leading
`fgDebugCheckExceptionSets()` to check the tree and assert. To fix this,
at the end of the `optComputeLoopSideEffectsOfBlock()`, clear the VN in case
it was previously set.
Fixes #81675
Bruce Forstall [Wed, 22 Feb 2023 18:42:44 +0000 (11:42 -0700)]
Fix unbalanced bracket in GenTree output (#82332)
Tlakaelel Axayakatl Ceja [Wed, 22 Feb 2023 18:38:54 +0000 (10:38 -0800)]
Share test cases for NativeAOT (#82216)
Remove Mono.Linker.Tests.Cases and Mono.Linker.Tests.Cases.Expectations from NativeAOT and reuse the ones in illink
Update some of the NativeAOT tests
Disable tests that have not been triaged in nativeAOT
Add the capability to IgnoreTests only for certain configurations
Sync tests between illink and NativeAOT and apply fixes when necessary to make them work
dotnet-maestro[bot] [Wed, 22 Feb 2023 17:23:59 +0000 (11:23 -0600)]
[main] Update dependencies from dotnet/arcade (#82342)
* Update dependencies from https://github.com/dotnet/arcade build
20230217.2
Microsoft.DotNet.Arcade.Sdk , Microsoft.DotNet.Build.Tasks.Archives , Microsoft.DotNet.Build.Tasks.Feed , Microsoft.DotNet.Build.Tasks.Installers , Microsoft.DotNet.Build.Tasks.Packaging , Microsoft.DotNet.Build.Tasks.TargetFramework , Microsoft.DotNet.Build.Tasks.Templating , Microsoft.DotNet.Build.Tasks.Workloads , Microsoft.DotNet.CodeAnalysis , Microsoft.DotNet.GenAPI , Microsoft.DotNet.GenFacades , Microsoft.DotNet.Helix.Sdk , Microsoft.DotNet.PackageTesting , Microsoft.DotNet.RemoteExecutor , Microsoft.DotNet.SharedFramework.Sdk , Microsoft.DotNet.VersionTools.Tasks , Microsoft.DotNet.XUnitConsoleRunner , Microsoft.DotNet.XUnitExtensions
From Version 8.0.0-beta.23115.1 -> To Version 8.0.0-beta.23117.2
* Update dependencies from https://github.com/dotnet/arcade build
20230218.1
Microsoft.DotNet.Arcade.Sdk , Microsoft.DotNet.Build.Tasks.Archives , Microsoft.DotNet.Build.Tasks.Feed , Microsoft.DotNet.Build.Tasks.Installers , Microsoft.DotNet.Build.Tasks.Packaging , Microsoft.DotNet.Build.Tasks.TargetFramework , Microsoft.DotNet.Build.Tasks.Templating , Microsoft.DotNet.Build.Tasks.Workloads , Microsoft.DotNet.CodeAnalysis , Microsoft.DotNet.GenAPI , Microsoft.DotNet.GenFacades , Microsoft.DotNet.Helix.Sdk , Microsoft.DotNet.PackageTesting , Microsoft.DotNet.RemoteExecutor , Microsoft.DotNet.SharedFramework.Sdk , Microsoft.DotNet.VersionTools.Tasks , Microsoft.DotNet.XUnitConsoleRunner , Microsoft.DotNet.XUnitExtensions
From Version 8.0.0-beta.23115.1 -> To Version 8.0.0-beta.23118.1
* Update dependencies from https://github.com/dotnet/arcade build
20230220.1
Microsoft.DotNet.Arcade.Sdk , Microsoft.DotNet.Build.Tasks.Archives , Microsoft.DotNet.Build.Tasks.Feed , Microsoft.DotNet.Build.Tasks.Installers , Microsoft.DotNet.Build.Tasks.Packaging , Microsoft.DotNet.Build.Tasks.TargetFramework , Microsoft.DotNet.Build.Tasks.Templating , Microsoft.DotNet.Build.Tasks.Workloads , Microsoft.DotNet.CodeAnalysis , Microsoft.DotNet.GenAPI , Microsoft.DotNet.GenFacades , Microsoft.DotNet.Helix.Sdk , Microsoft.DotNet.PackageTesting , Microsoft.DotNet.RemoteExecutor , Microsoft.DotNet.SharedFramework.Sdk , Microsoft.DotNet.VersionTools.Tasks , Microsoft.DotNet.XUnitConsoleRunner , Microsoft.DotNet.XUnitExtensions
From Version 8.0.0-beta.23115.1 -> To Version 8.0.0-beta.23120.1
---------
Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Ankit Jain [Wed, 22 Feb 2023 16:29:04 +0000 (11:29 -0500)]
[wasi] Add `WasiAppBuilder` task (#82126)
* Address review feedback from @pavelsavara
Adeel Mujahid [Wed, 22 Feb 2023 15:39:25 +0000 (17:39 +0200)]
Revert changes in libunwind vendor directory (#82473)
Milos Kotlar [Wed, 22 Feb 2023 14:20:42 +0000 (15:20 +0100)]
[mono][aot] Enable dedup on tvOS device + arm64 simulators (#82403)
* Enable dedup on ioslike platforms (tvOS device + arm64 simulators)
Katelyn Gadd [Wed, 22 Feb 2023 12:48:07 +0000 (04:48 -0800)]
[jiterp] Inline some performance-sensitive operations into traces (#82469)
Inline getchr, strlen, and getitem_span into traces
Use offsetof to compute more offsets used by the jiterpreter instead of hand computing them
Qiao Pengcheng [Wed, 22 Feb 2023 10:41:06 +0000 (05:41 -0500)]
[LoongArch64] redesign the compare and condition-branch. (#82426)
* [LoongArch64] redesign the compare and condition-branch.
* delelet the unused GT_TEST* nodes.
Mike McLaughlin [Wed, 22 Feb 2023 07:27:54 +0000 (23:27 -0800)]
Fix DBI loading problem on Linux (#82461)
* Fix DBI loading problem on Linux
Part of PR https://github.com/dotnet/runtime/pull/81573 needed to be undone to build libmscordbi.so without
any undefined symbols from the DAC. The DAC_PAL_RegisterModule, etc. stubs I recommended didn't work and DBI
could not be loaded by SOS because of missing exports.
The double pass at the libraries from the `target_link_libraries(mscordbi ${COREDBI_LIBRARIES} ${COREDBI_LIBRARIES})`
cmake file needed to be restored. The stubs were not needed after that.
* Fix clang16 build problems
Juan Hoyos [Wed, 22 Feb 2023 06:45:12 +0000 (22:45 -0800)]
Add pool provider template reference (#82452)
Use template to determine pool provider to use.
The provider can't be expanded in the pipeline-with-resources step as the expansion breaks once global variables are consolidated. All variables end up in the global scope correctly, but several expansion points are expanded before assignment - particularly the ones at the pipeline scope - meaning that several parameters derived from them are empty and cause issues in further expansion decisions.
Juan Hoyos [Wed, 22 Feb 2023 06:44:13 +0000 (22:44 -0800)]
Update Microsoft.DiaSymReader.Native from 16.9.0-beta1.21055.5 to 16.11.23-beta1.23063.1 (#82188)
Tom Deseyn [Wed, 22 Feb 2023 04:57:34 +0000 (05:57 +0100)]
corehost: derive fallback rid from output rid. (#82163)
Elinor Fung [Wed, 22 Feb 2023 01:23:48 +0000 (17:23 -0800)]
Format host tracing for deps parsing for easier reading (#82333)
Vitek Karas [Wed, 22 Feb 2023 00:42:00 +0000 (16:42 -0800)]
Remove invalid internal attribute which causes warnings (#82398)
The invalid attribute name is a valid test, but the smoke tests don't have the infra to validate warnings.
So producing the warning there is just noise in the build.
Once we port over all linker tests this will be validated by those. Specifically https://github.com/dotnet/runtime/blob/
0fe8bd36734b31e80abebf28380656fc18734645/src/tools/illink/test/Mono.Linker.Tests.Cases/LinkAttributes/LinkerAttributeRemoval.xml.
Aleksey Kliger (λgeek) [Tue, 21 Feb 2023 23:36:34 +0000 (18:36 -0500)]
[mono] Use more idiomatic cmake style (#82182)
Make mono's build use a slightly more idiomatic `cmake` style:
* One `project()` per subdirectory, rather than just in `mini`
* toplevel `add_subdirectory` for each subdirectory
* specify sources relative to the current project source dir, rather than using `addprefix` to relativize everything from `mini`
* use object libraries for each logical grouping. Set compile definitions, link libraries, etc on the object libraries.
* Have the final toplevel exes and shared libs (in mini; and components - when components are built to shared libs) pull in the object libraries. When building a static libmonosgen-2.0.a, pull in all the obejct libraries' objects to make a complete archive.
Doesn't untangle `src/mono/mono/components` from `src/mono/moni/mini` yet, although things could be grouped better there too.
* make eglib into a cmake object library
The goal is to use the cmake targets instead of _sources and _headers variables as well as to use the cmake add_subdirectory commands to bring in parts of the build
* make mono/utils into a cmake object library
* make sgen into a cmake object library
* make metadata into a cmake object library
* set MONO_DLL_EXPORT when building the object libraries
* add eglib_api target
unlike eglib_objects, this one can be added by executables and static or shared libraries without pulling in the eglib sources. This is what we want for dynamic runtime components, static interpreter and icall table libs, etc
* when building a static library, include all the ojects
otherwise it would only include the mini objects - it's not transitive
* nit use target_compile_definitions for sgen
* log profiler links eglib objects, not just headers
* set project languages to C
except for mini where we also enable CXX under some conditions (LLVM or ICU, or browser wasm)
* fix darwin framework builds
* fix for older cmake
can't have sources directly on add_library(target INTERFACE ...)
* fix windows build
* remove unneeded define
it's set later in the cmake file already
xtqqczze [Tue, 21 Feb 2023 22:35:27 +0000 (22:35 +0000)]
Replace `SafeLocalAllocHandle` in `System.Net.HttpListener` (#82411)
Lee Culver [Tue, 21 Feb 2023 21:44:01 +0000 (13:44 -0800)]
Add LoaderAllocator as a dac/sos concept (#82437)
* Add LoaderAllocator as a dac/sos concept
- DacpModuleData: Repurposed two unused fields to produce the module's LoaderAllocator and ThunkHeap. The LoaderAllocator often will be the same as the SystemDomain's, except in the case of collectable assemblies.
- Added the way to get the direct LoaderAllocator address from an AppDomain.
- Added a new way to enumerate the heaps associated with a LoaderAllocator in a future-proof way. Now when the implementation of CLR changes to add, remove, or rename/repurpose an existing heap, we can still produce the right diagnostic data without needing to ship a new interface.
This does expose LoaderAllocators as a new concept to the dac, but the original design of hiding them actually causes a lot more problems than it solves.
For example, the SystemDomain and AppDomain share the same LoaderAllocator and associated heaps...but that implementation detail is opaque to something like ClrMD or SOS (and was different on desktop CLR, so it's tough to take a dependency on that detail). This means things like !eeheap would dutifully double report heap ranges and sizes.
We also now need to know AppDomain's LoaderAllocator address to compare to DacpModuleData's to see if we should enumerate that module's heaps or not.
* Assign kinds, don't use _countof
- Add missing assignment to pKinds.
- Don't use _countof because non MSVC compilers don't like it
* Make LoaderHeapCount's usage more obvious
* Use ARRAY_SIZE()
Tanner Gooding [Tue, 21 Feb 2023 20:35:33 +0000 (12:35 -0800)]
Expose missing BinaryPrimitives APIs (#82310)
* Expose missing BinaryPrimitives APIs
* Fix the BinaryPrimitives doc comments to match the actual documentation
* Use newer BinaryPrimitives APIs where applicable
Vitek Karas [Tue, 21 Feb 2023 19:27:09 +0000 (11:27 -0800)]
Fix GetHashCode implementation for InterproceduralState (#82431)
This is a port of https://github.com/dotnet/linker/pull/3163 to runtime repo.
Dong-Heon Jung [Tue, 21 Feb 2023 18:43:20 +0000 (03:43 +0900)]
[RISC-V] others except coreclr (#82382)
* [RISCV-V] others except coreclr
- Successfully cross-build for RISC-V.
- Run A simple application "helloworld"
- Fail a test in clr.paltest
* Add risc-v
* Put riscv64 to the last
Elinor Fung [Tue, 21 Feb 2023 16:49:46 +0000 (08:49 -0800)]
Add test that uses the host's fallback RID (#82076)
Tom Deseyn [Tue, 21 Feb 2023 13:19:41 +0000 (14:19 +0100)]
Console.Unix: fix escape sequence for setting title on 'screen' TERM. (#82340)
Vitek Karas [Tue, 21 Feb 2023 10:04:36 +0000 (02:04 -0800)]
Fix generic parameter data flow validation in NativeAOT (#82392)
[This is a revert of a revert of #81532 with additional fixes for #81779]
This reworks how generic parameter data flow validation is done in the NativeAOT compiler.
Previously generic data flow was done from generic dictionary nodes. Problem with that approach is that there's no origin information at that point. The warnings can't point to the place where the problematic instantiation is in the code - we only know that it exists.
Aside from it being unfriendly for the users, it means any RUC or suppressions don't work on these warnings the same way they do in linker/analyzer.
This change modifies the logic to tag the method as "needs data flow" whenever we spot an instantiation of an annotated generic in it somewhere.
Then the actual validation/marking is done from data flow using the trim analysis patterns.
The only exception to this is generic data flow for base types and interface implementations, that one is done on the EEType nodes.
Note that AOT implements a much more precise version of the generic data flow validation as compared to linker/analyzer. See the big comment at the beginning of `GenericParameterWarningLocation.cs` for how that works.
Due to an issue with DependencyInjection, this change also implements a behavior where if a method or field is reflection accessible, the compiler will perform generic argument data flow on all types in the signature of the method/field (which it normally wouldn't do). See #81358 for details about the issue and discussions on the fix approach.
Due to the DI behavior described above, there's also the problem with nested generics. If a nested generic applies annotation on a specific type and this whole thing is done from within a DI, the compiler will not apply the annotation, since it doesn't see the type being used anywhere for real. See #81779 for detailed description of the issue. The fix for this is to extend the "needs data flow analysis" logic to look into generic arguments recursively and finding any annotation then triggers the data flow processing of the calling code. Then in that processing when applying generic argument data flow, do so recursively over all generic parameters.
Test changes:
Adds the two tests from linker which cover this functionality.
Change the test infra to use token to compare message origins for expected warnings. Consistently converting generic types/methods into strings across two type systems is just very difficult - the tokens are simple and reliable.
Changes the tests to avoid expecting specific generic types/methods formatting in the messages - again, it's too hard to make this consistent without lot of effort. And the tests don't really need it.
Adds a test for marking behavior related to generic argument data flow. This is to catch issues like #81779.
Adds a smoke test which has a simplified version of the DI problem from https://github.com/dotnet/runtime/issues/81358.
Fixes https://github.com/dotnet/runtime/issues/77455
Fixes https://github.com/dotnet/runtime/issues/75898
Fixes #81358
Fixes #81779
Jakob Botsch Nielsen [Tue, 21 Feb 2023 08:58:51 +0000 (09:58 +0100)]
SPMI: Indent details sections via CSS (#82375)
dotnet-maestro[bot] [Tue, 21 Feb 2023 08:13:55 +0000 (09:13 +0100)]
[main] Update dependencies from dotnet/roslyn (#81164)
Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Jeremy Koritzinsky <jkoritzinsky@gmail.com>
Co-authored-by: vitek-karas <10670590+vitek-karas@users.noreply.github.com>
Co-authored-by: pavelsavara <pavel.savara@gmail.com>
Co-authored-by: Marek Safar <marek.safar@gmail.com>
Radek Doulik [Tue, 21 Feb 2023 07:51:05 +0000 (08:51 +0100)]
[mono] Disable few quaternion intrinsics (#82410)
* Disable few quaternion intrinsics
For * and / operators as these are not the same as vector operations.
Opened https://github.com/dotnet/runtime/issues/82408 to implement
correct ones in future.
* Change comparison order
Zoltan Varga [Tue, 21 Feb 2023 05:46:41 +0000 (00:46 -0500)]
[mono][wasm] Fix ldftn in AOT mode, it should return a ftndesc. (#82282)
* [mono][wasm] Fix ldftn in AOT mode, it should return a ftndesc.
Fixes https://github.com/dotnet/runtime/issues/82272.
* Reenable tests.
Michal Strehovský [Tue, 21 Feb 2023 03:39:23 +0000 (12:39 +0900)]
Build test tree with partial trimming (#82157)
Some tests are not compatible with trimming. There are some that fail if they can't find things they need. There are also some that reflection-interate over test methods and will happily succeed if they don't find any test methods.
Michal Strehovský [Tue, 21 Feb 2023 03:37:55 +0000 (12:37 +0900)]
Remove fixed test from issues.targets (#82378)
Fixed in #82346.
Zoltan Varga [Tue, 21 Feb 2023 00:38:54 +0000 (19:38 -0500)]
[mono][wasi] Bump wasmtime to 5.0.0 (#82390)
Evgeniy [Tue, 21 Feb 2023 00:28:36 +0000 (03:28 +0300)]
Fix link to container image in linux instructions (#82409)
I suppose head of the URL was redondant — gave me "docker: invalid refence format" when I tried the original command, and worked fine when I removed the first "mcr.microsoft.com/dotnet-buildtools/prereqs:"
Ivan Diaz Sanchez [Mon, 20 Feb 2023 23:07:30 +0000 (15:07 -0800)]
[Continuation] - Enable the fundamentals behind libraries tests compiled via Crossgen2 (#80946)
* Added the documentation regarding the new libraries test modes.
* Enable the fundamentals behind libraries tests compiled via crossgen2.
* Fixed a typo with SINGLE_FILE_TEST_RUNNER.
* Addressed review comments.
* Restored an accidentally deleted comment.
* Fixed wrong Crossgen2 path and added comment with link to an important tracking SDK bug.
Stephen Toub [Mon, 20 Feb 2023 22:15:14 +0000 (17:15 -0500)]
Make more progress on IDE0044 ("Make field readonly") (#82356)
* Make more progress on IDE0044 ("Make field readonly")
* Apply suggestions from code review
Co-authored-by: Jan Kotas <jkotas@microsoft.com>
---------
Co-authored-by: Jan Kotas <jkotas@microsoft.com>
Stephen Toub [Mon, 20 Feb 2023 22:14:59 +0000 (17:14 -0500)]
Use ArgumentOutOfRangeException throw helpers in a few more places (#82357)
* Use ArgumentOutOfRangeException throw helpers in a few more places
* Fix a few tests to expect AOORE
Miha Zupan [Mon, 20 Feb 2023 21:27:04 +0000 (22:27 +0100)]
Optimize ReplaceLineEndings (#81630)
* Optimize ReplaceLineEndings
* PR feedback
Jakob Botsch Nielsen [Mon, 20 Feb 2023 20:58:35 +0000 (21:58 +0100)]
SPMI: Include example diffs in markdown summary (#82364)
This adds up to 3 improvement and 3 regression example diffs to the
markdown summary for each collection. The examples are picked to be the
highest percentage wise improvements and regressions with a limit on the
total size of the diff to avoid too much text in the diffs.
---------
Co-authored-by: Adeel Mujahid <3840695+am11@users.noreply.github.com>
Marie Píchová [Mon, 20 Feb 2023 20:11:49 +0000 (21:11 +0100)]
[QUIC] Improved logic of listener AcceptConnection (#82261)
* Slow connection handshakes do not stall any connections in accept queue.
* Listener tests
* PR feedback
* Test fix attempt
Egor Bogatov [Mon, 20 Feb 2023 14:42:44 +0000 (15:42 +0100)]
Fix unitialized local in impCastClassOrIsInstToTree (#82348)
Egor Bogatov [Mon, 20 Feb 2023 14:00:07 +0000 (15:00 +0100)]
Revert "Revert Allow some intrinsics in Tier0" (#82354)
Buyaa Namnan [Mon, 20 Feb 2023 10:31:48 +0000 (02:31 -0800)]
Unify type instantiations in reflection emit (#81518)
Milos Kotlar [Mon, 20 Feb 2023 09:09:49 +0000 (10:09 +0100)]
Update NativeAOT build integration targets to include ioslike platforms (#82086)
* Adjust Native AOT build integration targets to include ioslike platforms
* Exclude <NativeFramework Include=GSS /> for tvOS[simulator]
* Exclude System.Globalization.Native and System.Security.Cryptography.Native.OpenSsl for iOS platforms
* Exclude System.Globalization.Native and System.Security.Cryptography.Native.OpenSsl for iOSLike platforms
---------
Co-authored-by: Filip Navara <filip.navara@gmail.com>
Co-authored-by: Adeel Mujahid <3840695+am11@users.noreply.github.com>
Michal Strehovský [Mon, 20 Feb 2023 08:06:59 +0000 (17:06 +0900)]
Tiny speedup to HasGenericVirtualMethods (#82383)
This avoids materializing/resolving non-virtual methods.