Jakob Botsch Nielsen [Thu, 27 Apr 2023 17:16:33 +0000 (19:16 +0200)]
JIT: Propagate some more indir flags in physical promotion (#85453)
When physical promotion creates multiple indirections for arbitrary
BLK/FIELD sources, make sure we propagate all relevant flags.
Fix #85449
Qiao Pengcheng [Thu, 27 Apr 2023 17:12:40 +0000 (01:12 +0800)]
[LoongArch64] Implements the emitter::emitDispIns. (#85375)
* [LoongArch64] Implements the emitter::emitDispIns.
* LA64 don't support Instruction list before jump distance binding.
* delete some unused codes.
* amend code for CR.
Alexander Soldatov [Thu, 27 Apr 2023 17:11:59 +0000 (20:11 +0300)]
[RISC-V] GT_JMP implementation in codegen (#85416)
Added GT_JMP support to codegen. Based on ARM64 implemetation.
Dong-Heon Jung [Thu, 27 Apr 2023 17:11:25 +0000 (02:11 +0900)]
[RISC-V][JIT] JIT/CodeGenBringUpTest (#84748)
* [JIT] Update RISCV64
- Update Floating Point Compare
- Implement NYI functions
* [JIT] Update RISCV64
- Implement NYI functions
* [JIT] FIX TEST ERRORS
- Implement NYI functions
* [JIT] FIX TEST ERROR
- Update genFnPrologCalleeRegArgs
* [JIT] FIX TEST ERRORS
* [JIT] FIX TEST ERROR
Fix an error in ./JIT/CodeGenBringUpTests/struct16args_d/struct16args_d.sh
* [JIT] Fix rotate test errors
Fixed erros in belows
./JIT/CodeGenBringUpTests/Rotate_d/Rotate_d.sh
./JIT/CodeGenBringUpTests/Rotate_do/Rotate_do.sh
./JIT/CodeGenBringUpTests/Rotate_r/Rotate_r.sh
./JIT/CodeGenBringUpTests/Rotate_ro/Rotate_ro.sh
* [JIT] Fix erorrs in JTrueNeFP
Resolve
```
./JIT/CodeGenBringUpTests/JTrueNeFP_do/JTrueNeFP_do.sh
./JIT/CodeGenBringUpTests/JTrueNeFP_d/JTrueNeFP_d.sh
./JIT/CodeGenBringUpTests/JTrueNeFP_r/JTrueNeFP_r.sh
./JIT/CodeGenBringUpTests/JTrueNeFP_ro/JTrueNeFP_ro.sh
```
* [JIT] Fix an error
Add a missed part for making constant.
In the cases, it is -12.
Resolved
./JIT/CodeGenBringUpTests/NegRMW_do/NegRMW_do.sh
./JIT/CodeGenBringUpTests/NegRMW_ro/NegRMW_ro.sh
* [JIT] Optimize making constant a little
TODO-RISCV64: We should optimize constant and address construction.
* [JIT] Update emitIns_I_la more
* Add todo comment about code quality
* [JIT] Fix bugs in float and double
- Change fcvt to fmv in ins_Copy
* [JIT] Remove unnecessary comment
* [JIT] FIX
- Add rounding mode
* [JIT] Fix error
- Add Neg for float
- Add rounding mode in float arithmetic
* [JIT] Update Float Neg
* [JIT] Update rounding mode and register use
* [JIT] Update
- remove dead code
* [JIT] Support Float JumpCompare
* [JIT] Remove GT_OBJ and LCL_VAR_ADDR
* [JIT] JIT-FORMAT
* [JIT] Fix JCMP cond error
- Reverse JCMP cond for reversing jump opt
* Revert "[JIT] Fix JCMP cond error"
This reverts commit
bed8b9c12bd0340bc1519e1436d4acde209a9222.
* [JIT] Remove rounding mode comments
* [JIT] Fix Float-to-Float copy
* Update Alignment and Definitions
---------
Co-authored-by: Gleb Balykov <g.balykov@samsung.com>
Andy Gocke [Thu, 27 Apr 2023 16:56:15 +0000 (09:56 -0700)]
Store unhandled exception info on stack in Native AOT (#84871)
Allocates a span on the stack to hold the ToString of the exception, as well as a CrashRecord which contains a unique cookie that can be used to find the exception info.
Fixes #84636
dotnet-maestro[bot] [Thu, 27 Apr 2023 16:28:07 +0000 (11:28 -0500)]
[main] Update dependencies from dotnet/llvm-project dotnet/runtime-assets dotnet/emsdk dotnet/hotreload-utils dotnet/cecil (#85310)
* Update dependencies from https://github.com/dotnet/emsdk build
20230424.2
Microsoft.NET.Workload.Emscripten.Current.Manifest-8.0.100.Transport
From Version 8.0.0-preview.4.23219.1 -> To Version 8.0.0-preview.4.23224.2
* Update dependencies from https://github.com/dotnet/cecil build
20230424.2
Microsoft.DotNet.Cecil
From Version 0.11.4-alpha.23218.2 -> To Version 0.11.4-alpha.23224.2
* Update dependencies from https://github.com/dotnet/llvm-project build
20230424.3
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.23221.2 -> To Version 14.0.0-alpha.1.23224.3
* Update dependencies from https://github.com/dotnet/runtime-assets build
20230425.1
Microsoft.DotNet.CilStrip.Sources , System.ComponentModel.TypeConverter.TestData , System.Data.Common.TestData , System.Drawing.Common.TestData , System.Formats.Tar.TestData , System.IO.Compression.TestData , System.IO.Packaging.TestData , System.Net.TestData , System.Private.Runtime.UnicodeData , System.Runtime.Numerics.TestData , System.Runtime.TimeZoneData , System.Security.Cryptography.X509Certificates.TestData , System.Text.RegularExpressions.TestData , System.Windows.Extensions.TestData
From Version 8.0.0-beta.23218.1 -> To Version 8.0.0-beta.23225.1
* Update dependencies from https://github.com/dotnet/emsdk build
20230425.2
Microsoft.NET.Workload.Emscripten.Current.Manifest-8.0.100.Transport
From Version 8.0.0-preview.4.23219.1 -> To Version 8.0.0-preview.5.23225.2
* Update dependencies from https://github.com/dotnet/hotreload-utils build
20230425.6
Microsoft.DotNet.HotReload.Utils.Generator.BuildTool
From Version 8.0.0-alpha.0.23219.2 -> To Version 8.0.0-alpha.0.23225.6
* bump to p5
* Update dependencies from https://github.com/dotnet/hotreload-utils build
20230426.3
Microsoft.DotNet.HotReload.Utils.Generator.BuildTool
From Version 8.0.0-alpha.0.23219.2 -> To Version 8.0.0-alpha.0.23226.3
---------
Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Larry Ewing <lewing@microsoft.com>
Ankit Jain [Thu, 27 Apr 2023 15:47:53 +0000 (11:47 -0400)]
[wasm] Use latest stable version of chrome (#85114)
Michal Strehovský [Thu, 27 Apr 2023 13:43:27 +0000 (22:43 +0900)]
Delete support for IAT indirecting base type/interfaces (#85376)
* Delete support for IAT indirecting base type/interfaces
This is used if we have a SharedLibrary.dll a la .NET Native. SharedLibrary.dll model had a lot of problems around versioning and a "framework-dependent" deployment model like that is unlikely to come back. I think we can start to slowly get rid of and get marginally faster code and less maintenance cost in return.
* Bump header
Radek Zikmund [Thu, 27 Apr 2023 12:47:50 +0000 (14:47 +0200)]
Make some SystemNetSecurity properties public (#85402)
* Change API
* Fix Quic
* Expose TlsClientHelloInfo ctor
* Remove now unnecessary suppression file
* Add API comments
dotnet-maestro[bot] [Thu, 27 Apr 2023 08:46:44 +0000 (10:46 +0200)]
Update dependencies from https://github.com/dotnet/roslyn-analyzers build
20230425.2 (#85393)
Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Radek Doulik [Thu, 27 Apr 2023 08:43:31 +0000 (10:43 +0200)]
[mono] Add back OP_XOP_OVR_X_X for arm64 (#85401)
And also add missing intrinsic attributes.
This addresses feedback from https://github.com/dotnet/runtime/pull/85390
dotnet-maestro[bot] [Thu, 27 Apr 2023 08:41:13 +0000 (10:41 +0200)]
[main] Update dependencies from dotnet/arcade (#85308)
Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Adeel Mujahid [Thu, 27 Apr 2023 08:22:05 +0000 (11:22 +0300)]
Enable other native subsets for linux-riscv64 in CI (#85443)
Follow up on https://github.com/dotnet/runtime/commit/
277a28d0a357d2e568681efb400523f1cf848ecd (which enabled `linux-riscv64` coreclr build in the CI):
This PR adds `linux-riscv64 Release AllSubsets_Mono` leg in the CI to build `mono`, `libs`, `host` and `packs` subsets.
We are not running tests in the CI, but this leg is to protect the build from regressing.
Zoltan Varga [Thu, 27 Apr 2023 07:03:25 +0000 (03:03 -0400)]
[mono][llvm] Enable the cold calling conv on osx/linux. (#83519)
Kunal Pathak [Thu, 27 Apr 2023 06:10:15 +0000 (23:10 -0700)]
[Arm64] Replace pairs of `str` with `stp` (#85032)
* Add emitIns_SS_R_R_R_I()
* Introduce instrDescStrPair and use it
* rename some variables and fix a bug in outputInstr
* Rename to instrDescLclVarPair
* Add the missing SetIsLclVar()
* review feedback
* Use same code for GC/non-GC lclVar for stp'
* Use same code path for ldp/stp
* Just have asending/descending
* refactor code around emitOutputInstr()
* jit format
* Remove the comment
* Separate instrDescLclVarPair and instrDescLclVarPairCns
* useRsvdReg for assert
* add back the assert around `adr + ofs`
* Move OptimizeLdrStr() in emitarm64.cpp
* Update the assert for offset distance
* Rename emitIns_SS_R_R_R_I() to emitIns_R_R_R_I_LdStPair()
* jit format
* review feedback
Andy Ayers [Thu, 27 Apr 2023 01:05:59 +0000 (18:05 -0700)]
JIT: prefer edge counts; keep class profiles even if tossing counts (#85406)
If there are both edge and block counts for a method, prefer to use the
edge counts (block counts are no longer the default, so are more likely
to be stale).
Sometimes we decide not to use count data because of correlation or
solver issues. When this happens, keep the class profile data viable
and let the code that deals with class profiles handle the possibility
of stale or mismatched data.
Addresses some aspects of #84446, though it's still not clear why we see
static profiles with both block and edge counts.
Evgeny Karpov [Thu, 27 Apr 2023 00:45:00 +0000 (02:45 +0200)]
Add arm64 wasm support (#83677)
Andy Ayers [Wed, 26 Apr 2023 23:48:46 +0000 (16:48 -0700)]
JIT: fix phase status for some minimal instrumentation cases (#85411)
The instrumentation phase may modify the flow graph in anticipation of doing
some instrumentation, but then (because of minimal profiling) decide not to
instrument.
Make sure the phase status properly reflects that the phase made changes in
this case, and a few other cases where we exit early without actually doing
any instrumentation.
Fixes #85061.
Jakob Botsch Nielsen [Wed, 26 Apr 2023 22:43:47 +0000 (00:43 +0200)]
Fix physical promotion scenario name and a couple of bugs (#85343)
This was renamed but I forgot to update these occurrences. The result is
that runtime-jit-experimental is not actually running with physical
promotion enabled.
Also fix a couple of bugs that made it in in the meantime.
Jakob Botsch Nielsen [Wed, 26 Apr 2023 21:16:02 +0000 (23:16 +0200)]
JIT: Change GTF_ICON_INITCLASS -> GTF_IND_INITCLASS (#85396)
The JIT has a flag GTF_ICON_INITCLASS that represents that accesses off
that address are cctor dependent. Hoisting uses this to avoid hoisting
cctor dependent indirections unless all cctors are also hoisted.
However, local constant prop/VN-based constant prop do not handle this
flag, so we could run into cases where addresses with GTF_ICON_INITCLASS
were propagated and then subsequently hoisted incorrectly.
This change moves the flag to an OperIsIndir() flag instead of being a
flag on the constant. After some digging, I found that the original
reason the flag was not an indir flag was simply that there were no more
indir flags available, but we do have available flags today. This fix
is much simpler than the alternatives which would be to teach VN/local
copy prop to propagate this GTF_ICON_INITCLASS flag.
Also remove GTF_FLD_INITCLASS which is never set.
Anton Firszov [Wed, 26 Apr 2023 20:38:54 +0000 (22:38 +0200)]
Fix stress builds (#85342)
Fix #85338, by switching to centos-stream8
Stephen Toub [Wed, 26 Apr 2023 20:30:11 +0000 (16:30 -0400)]
Add CompositeFormat.MinimumArgumentCount and remove TryParse (#85348)
* Add CompositeFormat.MinimumArgumentCount
* Remove CompositeFormat.TryParse
It encourages bad patterns of consumption.
Jan Kotas [Wed, 26 Apr 2023 19:51:27 +0000 (12:51 -0700)]
Fix generic dictionary lookups for param types and function pointers (#85369)
* Fix generic dictionary lookups for param types and function pointers
Fixes #85240
* AllowUnsafeBlocks
* Disable test on Mono
Badre BSAILA [Wed, 26 Apr 2023 19:39:02 +0000 (21:39 +0200)]
let user know working directory will be used as content root path by default (#82445)
Michał Petryka [Wed, 26 Apr 2023 19:21:01 +0000 (21:21 +0200)]
Fix totalILArgs for explicithis (#85347)
* Fix totalILArgs for explicithis
* Fix missed places
Adeel Mujahid [Wed, 26 Apr 2023 19:07:58 +0000 (22:07 +0300)]
Add introspection for readelf (#85298)
Carlos Sánchez López [Wed, 26 Apr 2023 19:06:24 +0000 (12:06 -0700)]
Bump main preview version to 5 (#85368)
Buyaa Namnan [Wed, 26 Apr 2023 16:28:25 +0000 (09:28 -0700)]
AssemblyBuilder.Save add custom attributes handling. (#84580)
* Initial custom attributes handling
* Pseudo custom attributes handling and tests
* Use ReadOnlySpan for CustomAttribute binaryData
* Update some pseudo attributes handling and apply feedback
* Add one more pseudo attribute and a few small changes
* Move pseudo attributes handling
* Remove type loading logic from CustomAttributes parsing, use constants for some values
* Add MarshalAsAttribute handling and apply other feedbacks
---------
Co-authored-by: Aaron Robinson <arobins@microsoft.com>
Zoltan Varga [Wed, 26 Apr 2023 15:01:05 +0000 (11:01 -0400)]
[mono][jit] Add an option to use an mrgctx for all gshared methods. (#82981)
Enable it by default on WASM.
In this mode, all gshared methods get an mrgctx, which means they can access
their data using a simple load from the mrgctx instead of having to call
a rgctx fetch trampoline.
Upsides:
- much simpler.
- faster access to gshared data
- smaller code and data size in the AOT case
- if enabled by default on all platforms, large amount of gshared
code can be removed
Downsides:
- the methods have to initialize their mrgctx in their prolog
- on non-wasm platforms, indirect calls to gshared methods
(like virtual calls) will need to use rgctx trampolines more often
to pass the mrgctx.
Pavel Savara [Wed, 26 Apr 2023 14:24:59 +0000 (16:24 +0200)]
[wasm][nodejs] enable EH for unit tests (#85387)
Ivan Diaz Sanchez [Wed, 26 Apr 2023 14:16:19 +0000 (07:16 -0700)]
Made helixpublishwitharcade's TargetOS property lowercase. (#85357)
Fixes #81141. In PR #80164, the build scripts were updated to always require and/or convert the MSBuild `TargetOS` property to lowercase. However, the _helixpublishwitharcade.proj_ file was not included in these efforts, which led to some confusing behavior and misplaced files, as described in issue #81141. This PR addresses and fixes that.
Pavel Savara [Wed, 26 Apr 2023 14:11:22 +0000 (16:11 +0200)]
[browser] Fix webcil lazy loading and satellite assemblies in Wasm SDK (#85335)
Co-authored-by: Marek Fišera <mara@neptuo.com>
Jan Dupej [Wed, 26 Apr 2023 14:03:37 +0000 (16:03 +0200)]
[mono][jit] Adding Vector128.ConvertXX as intrinsic on arm64. (#85163)
* [mono][jit] Adding Vector128.ConvertXX as intrinsic on arm64.
* Changed rounding model on f->i conversion.
* Disabled f32->i32 casting test.
* Disabled all of failing JIT tests.
Will Smith [Wed, 26 Apr 2023 13:58:08 +0000 (06:58 -0700)]
Skip 84693 test (#85381)
Jan Dupej [Wed, 26 Apr 2023 12:47:57 +0000 (14:47 +0200)]
[mono][jit] Add Vector128.WithElement as intrinsic on arm64. (#85158)
* [mono][jit] Add Vector128.WithElement as intrinsic on arm64.
* Fixed store opcode mismatch.
* Optimize the nonconstant case only for Vector128 in mini.
Pavel Savara [Wed, 26 Apr 2023 12:00:30 +0000 (14:00 +0200)]
[wasm][WBT] Fix pack pattern take two (#85391)
Egor Bogatov [Wed, 26 Apr 2023 11:06:05 +0000 (13:06 +0200)]
Implement ICorProfilerInfo14::EnumerateNonGCObjects (#85100)
Jakob Botsch Nielsen [Wed, 26 Apr 2023 08:04:03 +0000 (10:04 +0200)]
JIT: Introduce GT_JTEST and clean up GT_JCMP flags (#85242)
* Introduce GT_JTEST to replace GTF_JCMP_TEST
* Stop encoding JCMP conditions in GenTreeFlags by switching GT_JCMP to
a GenTreeOpCC node. This removes GTF_JCMP_EQ and the
LoongArch64/RISC-V specific mechanism to communicate condition codes
to the backend via gtFlags.
Egor Bogatov [Wed, 26 Apr 2023 07:34:39 +0000 (09:34 +0200)]
Fix simd12_t size (#85362)
Egor Bogatov [Wed, 26 Apr 2023 07:21:34 +0000 (09:21 +0200)]
Fold IND(frozenObj, CNS) (#85127)
Co-authored-by: Jakob Botsch Nielsen <Jakob.botsch.nielsen@gmail.com>
Will Smith [Wed, 26 Apr 2023 07:08:06 +0000 (00:08 -0700)]
[JIT] ARM64 - Fixed regressions for `GT_NEG` containment (#85230)
* Fixed regressions for 'GT_NEG' containment on ARM64
* Containing NEG is only valid for EQ and NE.
* Update codegenarm64.cpp
* Formatting
Vlad-Alexandru Ionescu [Wed, 26 Apr 2023 06:27:29 +0000 (08:27 +0200)]
Change `callvirt` into `calli` for virtual delegates (#83461)
JIT delegates do not depend on the target method and an call is used
---------
Signed-off-by: Vlad - Alexandru Ionescu <vlad-alexandruionescu@Vlads-MacBook-Pro-2.local>
Co-authored-by: Vlad - Alexandru Ionescu <vlad-alexandruionescu@Vlads-MacBook-Pro-5.local>
Egor Bogatov [Wed, 26 Apr 2023 05:34:01 +0000 (07:34 +0200)]
Don't re-scan previously visited blocks in helperexpansion.cpp (#85201)
Aleksey Kliger (λgeek) [Wed, 26 Apr 2023 01:55:38 +0000 (21:55 -0400)]
[Wasm.Build.Tests] Fixup wildcard matching for runtime packs (#85286)
The naming is
`Microsoft.NETCore.App.Runtime.Mono.{variant}.{rid}.{version}.nupkg`
Fixes local WBT builds for non-default runtime variants (eg: build
with `/p:MonoWasmBuildVariant=multithread` then run WBT)
Michal Strehovský [Wed, 26 Apr 2023 01:09:13 +0000 (10:09 +0900)]
Guard DynamicDependency processing against `TypeSystemException`s (#85285)
Works around https://github.com/dotnet/fsharp/issues/15140 and it's also just good hygiene.
Sven Boemer [Wed, 26 Apr 2023 00:55:36 +0000 (17:55 -0700)]
Re-enable PGO for linux (#85355)
Aleksey Kliger (λgeek) [Tue, 25 Apr 2023 23:58:51 +0000 (19:58 -0400)]
[hot_reload] assorted hot reload fixes for cumulative property updates (#85351)
* [hot_reload] remove unneeded assertion
`is_addition` is already defined as `token_index-1 >=
delta_info->count[token_table].prev_gen_rows` so:
1. the assertion as written is wrong for cumulative updates that add
new properties or events
2. the assertion would be trivially true if it was updated to use
`delta_info->count[token_table].prev_gen_rows`.
Fixes the ability to cumulatively add new properties
* Update generation on MonoClassMetadataUpdateInfo when adding members
Give recompute_ginst_update_info something to work with.
* assert that generic instances don't call hot_reload_get_property
token-based lookup should only happen for class defs or GTDs
* update regression test
Andy Ayers [Tue, 25 Apr 2023 23:52:56 +0000 (16:52 -0700)]
JIT: improve profile update for loop inversion (#85265)
If the loop test block has multiple predecessors we will not do proper
profile updates. This can lead to downstream problems with block layout
(say leaving a cold block in a loop).
Fix by changing how we compute the amount of profile that should remain
in the test block.
Fixes #84319.
Andy Ayers [Tue, 25 Apr 2023 23:50:22 +0000 (16:50 -0700)]
JIT: add ssa accounting to morph's div opts (#85332)
RBO triggered a morph opt that cloned an SSA local, throwing off the SSA
accounting. Fix by invoking the accounting helper after the morph expansion.
Closes #85226.
Tom Deseyn [Tue, 25 Apr 2023 23:44:39 +0000 (01:44 +0200)]
Directory.Build.props: don't overwrite PackageOS from source-build. (#85350)
Eric StJohn [Tue, 25 Apr 2023 21:59:52 +0000 (14:59 -0700)]
Add Winforms as consultant on ComponentModel (#85363)
Stephen Toub [Tue, 25 Apr 2023 21:59:15 +0000 (17:59 -0400)]
Fix a few downlevel TimeProvider issues (#85346)
- Consistently null check the Timer stored in the state object
- Complete the a task canceled due to the CancellationToken with the CancellationToken
- Avoid an unnecessary closure in Delay
- Make TimeProvider.System.CreateTimer use Timer's ctor that takes duration/period rather than making a separate call to Change
Marek Fišera [Tue, 25 Apr 2023 20:08:10 +0000 (22:08 +0200)]
[wasm] Disable `Wasm.Build.Tests.Blazor.BuildPublishTests.BugRegression_60479_WithRazorClassLib` (#85356)
* Add active issue on blazor lazy load test
* Add active issue on blazor lazy load test
Stephen Toub [Tue, 25 Apr 2023 20:05:30 +0000 (16:05 -0400)]
Use CollectionsMarshal.SetCount in LINQ to deduplicate ToArray/ToList implementations (#85288)
* Use CollectionsMarshal.SetCount in LINQ to deduplicate ToArray/ToList implementations
* Fix BinaryFormatter test
The test was implemented using ToList, and `List<T>` serialization serializes out its version field. As a result, because we're now optimizing creation and not incrementing the version as much in ToList, the blob didn't match.
Sven Boemer [Tue, 25 Apr 2023 19:56:57 +0000 (12:56 -0700)]
Fix Avx2 helpers (#85275)
Unblocks dotnet-optimization flow and
https://github.com/dotnet/runtime/issues/84711. Includes a
dotnet-optimization update to confirm this it avoids the issue
discussed in https://github.com/dotnet/runtime/pull/84635. This
fixes that issue by preventing R2R for any Avx2 helpers which
assume they are called with Avx2 enabled.
Tom Deseyn [Tue, 25 Apr 2023 19:50:19 +0000 (21:50 +0200)]
init-distro-rid.sh: fix unbound error when VERSION_ID is not defined. (#85319)
Filip Navara [Tue, 25 Apr 2023 18:46:56 +0000 (20:46 +0200)]
[mono][NativeAOT] System.Globalization.Native build improvements (#82393)
Fixes #82389
- Fixes build of System.Globalization.Native for iOS-like, browser, and wasi platforms
- Removes ICU shim from static builds of Mono runtime and builds it as part of libs.native subset
- Switches browser/wasi to use the static libraries
Co-authored-by: Alexander Köplinger <alex.koeplinger@outlook.com>
Jakob Botsch Nielsen [Tue, 25 Apr 2023 18:13:58 +0000 (20:13 +0200)]
JIT: Create side effect commas as TYP_VOID in block morph (#85320)
This code could create IR shapes like
COMMA struct
...
ASG struct
dst
src
After liveness that would sometimes result in
COMMA struct
...
NOP void
which could confuse optimization phases when JitOptRepeat was enabled.
The more canonical shape for these side-effecting GT_COMMA nodes has
them TYP_VOID typed as shown by gtExtractSideEffList, so do the same in
block morph.
Fix #85037
Tanner Gooding [Tue, 25 Apr 2023 18:11:09 +0000 (11:11 -0700)]
Expose various Convert intrinsics for Avx512F, Avx512BW, and Avx512DQ (#85281)
* Expose various Convert intrinsics for Avx512F and Avx512DQ
* Expose various integer conversion APIs for Avx512F and Avx512BW
* Ensure special instructions are handled in codegen
* Apply formatting patch
* Ensure the AVX512F_VL variant is picked for simdSize=16/32
* Ensure conversion instructions are handled in PERFSCORE
* Ensure instructions use the right tuple type
* Removing an invalid API and fix more PERFSCORE entries
* Resolve additional failures masked by #85056
* Ensure TieredCompilation=0 is also passing
* Apply formatting patch
* Fixing some more test edge cases
* Ensure uint64->double and uint64->Float masks the input
Jakob Botsch Nielsen [Tue, 25 Apr 2023 17:33:37 +0000 (19:33 +0200)]
SPMI: Always add authenticated pip feed for test job runs (#85327)
We always try to upload the collections for the tests, even on failures,
so we should also add the authed feed on failures.
mikelle-rogers [Tue, 25 Apr 2023 17:32:19 +0000 (10:32 -0700)]
EnC Support for Generics (#85269)
* EnC non-functional changes
- Update inappropriate naming
- Update many logging statements
- Remove unused code
* EnC support for fields on generic types
* EnC support for methods on generic types
* Fix use after free introduced in EnC breakpoint.
Fix off by one for string logging.
* update new feature capabilities, JIT GUID
* Fix non-enc build
* Fix EnCFieldIndex check
* Remove IsFdPrivate assert
---------
Co-authored-by: Aaron R Robinson <arobins@microsoft.com>
Co-authored-by: Juan Hoyos <19413848+hoyosjs@users.noreply.github.com>
Co-authored-by: Tom McDonald <tommcdon@microsoft.com>
Austin Wise [Tue, 25 Apr 2023 16:26:32 +0000 (09:26 -0700)]
NativeAOT ComWrappers: fix race condition in when creating native wrapper (#85235)
Krzysztof Wicher [Tue, 25 Apr 2023 16:26:03 +0000 (18:26 +0200)]
Populating JSON properties support (#83669)
* Populating JSON properties support
* apply review feedback
* Attempt to fix build by reducing stack frame
* Fix docs
* Remove unnecessary properties from ReadStackFrame.
* Move source gen tests to the source gen test project.
* Improve test helper method name.
* Add argument validation to JsonPropertyInfo.ObjectCreationHandling & extend unit testing for the new metadata APIs.
* Add test coverage for invalid attribute annotations.
---------
Co-authored-by: Eirik Tsarpalis <eirik.tsarpalis@gmail.com>
Ivan Povazan [Tue, 25 Apr 2023 16:09:40 +0000 (18:09 +0200)]
[NativeAOT] Do not strip exported symbols from executables on Apple platforms (#85293)
* Do not strip exported symbols from executables when explicitly specified
* Add '_' prefix to StripFlag internal project property
Stephen Toub [Tue, 25 Apr 2023 16:03:33 +0000 (12:03 -0400)]
Make Guid.HexsToChars aggressively inlined (#85322)
To help mono cope with the genericized implementation. This method is only used when Ssse3 or AdvSimd.Arm64 are not supported, or when formatting the rarely-used "X" format, but currently mono AOT without LLVM doesn't enable those intrinsics.
Stephen Toub [Tue, 25 Apr 2023 16:02:20 +0000 (12:02 -0400)]
Retry compat Random.NextSingle in case rounding from double produces 1.0f (#85321)
The compat implementation behind Random just casts a double to a float to produce the result of NextSingle. Some double values close to 1.0 might round up to 1.0f, which is out of range for NextSingle. In that case, reject it and retry. This approach is consistent with how fairness is handled elsewhere in the implementation, and avoids changing the sequence of values returned for a fixed seed in cases where an illegal value wasn't being returned.
Marek Fišera [Tue, 25 Apr 2023 15:56:02 +0000 (17:56 +0200)]
Fix publishing relinked dotnet.worker.js (#85314)
Radek Zikmund [Tue, 25 Apr 2023 15:50:34 +0000 (17:50 +0200)]
Add TargetHostName to QuicConnection (#84976)
* Add TargetHostName to QuicConnection
Fixes #80508
* Make TargetHostName not nullable
* Fix build
* Fix build of tests
* Fix failing tests
* Code review feedback
* Use unencoded hostname in user-facing properties/params
* Fix failing tests
* Revert unwanted changes
* Add test for IDN cert validation
* Fix test again
* Fix trailing dot in hostname
Radek Doulik [Tue, 25 Apr 2023 15:33:11 +0000 (17:33 +0200)]
[wasm] Add more PackedSimd methods, logic ops (#85303)
* [wasm] Add more PackedSimd methods
* Fix doc comments
Tarek Mahmoud Sayed [Tue, 25 Apr 2023 14:32:51 +0000 (07:32 -0700)]
Fix the TimeProvider test (#85268)
* Fix the TimeProvider test
* remove the assert
Tomáš Rylek [Tue, 25 Apr 2023 14:30:53 +0000 (16:30 +0200)]
Fix coreclr-release-outerloop-nightly pipeline (#85278)
Dong-Heon Jung [Tue, 25 Apr 2023 14:28:27 +0000 (23:28 +0900)]
[RISC-V] Add RISC-V CI (#85289)
- Add RISC-V Checked Build CI
- https://github.com/dotnet/runtime/issues/84834
Jakob Botsch Nielsen [Tue, 25 Apr 2023 13:57:48 +0000 (15:57 +0200)]
JIT: Support some assignment decomposition in physical promotion (#85105)
Add support for directly initializing and copying into replacements
instead of doing a struct local and read back. Physically promoted
struct locals used as sources are still handled conservatively (by first
writing them back to stack, then doing the copy).
For example, for a case like
```
void Foo()
{
S s = _field;
s.A = s.B + 3;
Consume(s);
}
struct S
{
public int A, B;
}
```
We see the following:
```
STMT00000 ( 0x000[E-] ... 0x006 )
[000003] -A-XG------ ▌ ASG struct (copy)
[000002] D------N--- ├──▌ LCL_VAR struct<Program+S, 8> V01 loc0
[000001] ---XG------ └──▌ FIELD struct Program:_field
[000000] ----------- └──▌ LCL_VAR ref V00 this (last use)
Processing block operation [000003] that involves replacements
New statement:
STMT00000 ( 0x000[E-] ... 0x006 )
[000029] -A-XG------ ▌ COMMA int
[000021] -A-XG------ ├──▌ ASG int
[000015] D------N--- │ ├──▌ LCL_VAR int V03 tmp1
[000020] ---XG------ │ └──▌ IND int
[000018] ----------- │ └──▌ ADD ref
[000016] ----------- │ ├──▌ LCL_VAR ref V00 this
[000017] ----------- │ └──▌ CNS_INT long 8
[000028] -A-XG------ └──▌ ASG int
[000022] D------N--- ├──▌ LCL_VAR int V04 tmp2
[000027] ---XG------ └──▌ IND int
[000025] ----------- └──▌ ADD ref
[000023] ----------- ├──▌ LCL_VAR ref V00 this
[000024] ----------- └──▌ CNS_INT long 12
```
The logic is currently quite rudimentary when it comes to
holes/uncovered parts of the struct. For example, in the above case if
we add another unused field at the end of S then the result is:
```
STMT00000 ( 0x000[E-] ... 0x006 )
[000003] -A-XG------ ▌ ASG struct (copy)
[000002] D------N--- ├──▌ LCL_VAR struct<Program+S, 12> V01 loc0
[000001] ---XG------ └──▌ FIELD struct Program:_field
[000000] ----------- └──▌ LCL_VAR ref V00 this (last use)
Processing block operation [000003] that involves replacements
Struct operation is not fully covered by replaced fields. Keeping struct operation.
New statement:
STMT00000 ( 0x000[E-] ... 0x006 )
[000030] -A-XG------ ▌ COMMA struct
[000021] -A-XG------ ├──▌ ASG int
[000015] D------N--- │ ├──▌ LCL_VAR int V03 tmp1
[000020] ---XG------ │ └──▌ IND int
[000018] ----------- │ └──▌ ADD ref
[000016] ----------- │ ├──▌ LCL_VAR ref V00 this
[000017] ----------- │ └──▌ CNS_INT long 8
[000029] -A-XG------ └──▌ COMMA struct
[000028] -A-XG------ ├──▌ ASG int
[000022] D------N--- │ ├──▌ LCL_VAR int V04 tmp2
[000027] ---XG------ │ └──▌ IND int
[000025] ----------- │ └──▌ ADD ref
[000023] ----------- │ ├──▌ LCL_VAR ref V00 this
[000024] ----------- │ └──▌ CNS_INT long 12
[000003] -A-XG------ └──▌ ASG struct (copy)
[000002] D------N--- ├──▌ LCL_VAR struct<Program+S, 12> V01 loc0
[000001] ---XG------ └──▌ FIELD struct Program:_field
[000000] ----------- └──▌ LCL_VAR ref V00 this
```
In this case it would be significantly more efficient to copy only the
remainder, which is just a small part of the struct. However, in the
general case it is not easy to predict the most efficient way to do
this, and in some cases we cannot even represent the hole in JIT IR (if
it involves GC pointers), so I have left this for a future change for
now. Liveness should also be beneficial for that as there are many cases
where we would expect the remainder to be dead.
madelson [Tue, 25 Apr 2023 13:47:38 +0000 (09:47 -0400)]
Remove useless serializability checks (#80957)
Alexander Köplinger [Tue, 25 Apr 2023 13:45:51 +0000 (15:45 +0200)]
[mono] Remove mono_dl_open_runtime_lib() (#85253)
It was only used to load the profiler from an "installed" path, but that is no longer a thing in modern .NET
Vlad Brezae [Tue, 25 Apr 2023 13:02:54 +0000 (16:02 +0300)]
[mono][interp] Fix il_offset of inserted instructions (#85305)
After the original codegen happens, where instructions have the associated il_offset set, we might still generate new instruction as part of various optimizations. They would have the associated il_offset of the end of the method which is incorrect and was screwing up mapping from native_offset to il_offset.
Michal Strehovský [Tue, 25 Apr 2023 08:51:41 +0000 (17:51 +0900)]
Add function pointer type support to type loader (#85287)
So that we can create new function pointer types at runtime within the context of `MakeGenericXXX`.
Jakob Botsch Nielsen [Tue, 25 Apr 2023 08:47:09 +0000 (10:47 +0200)]
JIT: Allow spill-at-single-def for pure defs (#85251)
Allow the spill-at-single-def logic to kick in for defs without subsequent uses before the spill.
Jakob Botsch Nielsen [Tue, 25 Apr 2023 08:45:57 +0000 (10:45 +0200)]
Add authenticated PIP feed before its use in internal JIT pipelines (#85292)
This unblocks internal JIT pipelines.
Jan Vorlicek [Tue, 25 Apr 2023 08:16:02 +0000 (10:16 +0200)]
Fix edge case in stack overflow handling (#85272)
There is a problematic case when the stack overflow happens in native code
and there is an explicit frame between the managed and native code. Some
time ago, I have added a fix for a problem when the stack overflow
happened in native code, but I haven't found that it actually works only
in case there is no explicit frame between the managed code and the
failing native code frame. That fix makes the `FaultingExceptionFrame`
that is created for the stack overflow to contain context of the managed
code frame, so the stack walker uses that to move to the next frame. But
while doing so, it hits the other explicit frame that it doesn't expect
there and fires an assert.
This fix handles the problematic case correctly.
dotnet-maestro[bot] [Tue, 25 Apr 2023 07:51:48 +0000 (09:51 +0200)]
[main] Update dependencies from dotnet/runtime (#85249)
Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
David Mason [Tue, 25 Apr 2023 06:51:20 +0000 (23:51 -0700)]
Disable gcstress and jitstress for tracing tests (#85186)
* Disable gcstress and jitstress
* Fix EventListenerThreadPool proj
---------
Co-authored-by: Juan Hoyos <19413848+hoyosjs@users.noreply.github.com>
Michal Strehovský [Tue, 25 Apr 2023 06:24:05 +0000 (15:24 +0900)]
Emit GC info into a COMDAT section (#83371)
Saves 3.14% on BasicWebApi. 🤯
We run linker with COMDAT folding enabled. Generating this data into COMDAT foldable section allows linker to deduplicate these.
Adeel Mujahid [Tue, 25 Apr 2023 05:46:16 +0000 (08:46 +0300)]
Specify -z notext on linux-musl-x86 and riscv64 (#83682)
* Specify -z notext on linux-musl-x86
* Fix riscv64 build with clang/lld v15+
* Inline visibility attribute
* Fix gcc build
Qiao Pengcheng [Tue, 25 Apr 2023 05:45:43 +0000 (13:45 +0800)]
refactor the g_SyncBlockCacheInstance for aligned (#85241)
Jeremy Koritzinsky [Tue, 25 Apr 2023 03:46:39 +0000 (20:46 -0700)]
Enable ComWrappers for NativeAOT on non-Windows (#85000)
Jeremy Koritzinsky [Tue, 25 Apr 2023 03:33:48 +0000 (20:33 -0700)]
Build Mono LLVM legs on the CBL-Mariner images, but run the AOTing steps on CentOS Stream 8 with binutils (#85273)
Stephen Toub [Tue, 25 Apr 2023 02:51:18 +0000 (22:51 -0400)]
Add Parallel.ForAsync (#84804)
* Add Parallel.ForAsync
* Apply suggestions from code review
Co-authored-by: Carlos Sánchez López <1175054+carlossanlop@users.noreply.github.com>
---------
Co-authored-by: Carlos Sánchez López <1175054+carlossanlop@users.noreply.github.com>
Stephen Toub [Tue, 25 Apr 2023 02:50:59 +0000 (22:50 -0400)]
Fix perf regressions in Utf8Formatter for integers (#85277)
When I added UTF8 support to the core numeric types, I also just routed Utf8Formatter to use the public TryFormat API on each type. That, however, regressed some microbenchmarks due to a) going from `StandardFormat` to a `ReadOnlySpan<char>` format and then parsing it back out and b) removing some of the inlining that was there previously. This change puts back into Utf8Formatter.TryFormat the handling of the format and then delegating to the relevant helpers that already exist rather than always going through the public entrypoint (it doesn't do so for 'n', but that's also much rarer to use on a hot path and is also in general more expensive).
Michał Petryka [Tue, 25 Apr 2023 01:14:10 +0000 (03:14 +0200)]
Add CollectionsMarshal.SetCount(list, count) (#82146)
* Add CollectionsMarshal.SetCount(list, count)
Adds the ability to resize lists, exposed in
CollectionsMarshal due to potentially risky
behaviour caused by the lack of element initialization.
Supersedes #77794.
Fixes #55217.
* Update XML doc
* Add missing using
* Fix test
* Update CollectionsMarshalTests.cs
* Update CollectionsMarshal.cs
* Update CollectionsMarshalTests.cs
* Update CollectionsMarshalTests.cs
Aleksey Kliger (λgeek) [Tue, 25 Apr 2023 00:49:02 +0000 (20:49 -0400)]
[native-library] If a dllimport is specified with an absolute path, look for it first (#85255)
The unmanaged native library probing documentation says to try
absolute paths without variations
https://learn.microsoft.com/en-us/dotnet/core/dependency-loading/default-probing#unmanaged-native-library-probing
Stephen Toub [Tue, 25 Apr 2023 00:29:35 +0000 (20:29 -0400)]
Add parsing error information to composite format string parsing exceptions (#85106)
* Add parsing error information to composite format string parsing exceptions
* Update src/libraries/System.Private.CoreLib/src/System/Text/CompositeFormat.cs
Co-authored-by: Carlos Sánchez López <1175054+carlossanlop@users.noreply.github.com>
---------
Co-authored-by: Carlos Sánchez López <1175054+carlossanlop@users.noreply.github.com>
Stephen Toub [Tue, 25 Apr 2023 00:28:43 +0000 (20:28 -0400)]
Add TextWriter.FlushAsync(CancellationToken) (#84325)
* Add TextWriter.FlushAsync(CancellationToken)
* Update src/libraries/System.Private.CoreLib/src/System/CodeDom/Compiler/IndentedTextWriter.cs
Co-authored-by: Carlos Sánchez López <1175054+carlossanlop@users.noreply.github.com>
---------
Co-authored-by: Carlos Sánchez López <1175054+carlossanlop@users.noreply.github.com>
Jacques Eloff [Mon, 24 Apr 2023 23:32:16 +0000 (16:32 -0700)]
Pass resource item to workload task (#85264)
Carlos Sánchez López [Mon, 24 Apr 2023 23:24:29 +0000 (16:24 -0700)]
Add exceptions to TAR extended attribute constructors to disallow '=' and '\n' characters in keys and values. (#82812)
* Prevent adding extended attribute keys containing '=', '\n', or values containing '\n'.
* Add tests to verify that the PaxTarEntry and PaxGlobalExtendedAttributesTarEntry constructors that take an extended attributes dictionary, throw when a disallowed character is found.
* Apply CR suggestions
* Use enumerator to iterate items in the specified enumeration, and insert them to the lazily created dictionary if they pass the validations.
* Change IndexOf with Contains
---------
Co-authored-by: carlossanlop <carlossanlop@users.noreply.github.com>
Andy Ayers [Mon, 24 Apr 2023 22:48:17 +0000 (15:48 -0700)]
JIT: Move some BasicBlock methods into block.cpp (#85224)
Collect up a few `BasicBlock` methods that were scattered about in other files.
Miha Zupan [Mon, 24 Apr 2023 22:33:45 +0000 (00:33 +0200)]
Use double VectorTableLookup on ARM in ProbabilisticMap (#85189)
* Avoid scalar fallback for logical right shift on Arm
* Use double VectorTableLookup on ARM in ProbabilisticMap
* Revert
3bfd7d3f82c8256c2d7d7ce9371de679d961df96
Egor Bogatov [Mon, 24 Apr 2023 21:27:15 +0000 (23:27 +0200)]
Skip covariant checks for ldelema T[] with T exact
Marek Fišera [Mon, 24 Apr 2023 19:54:29 +0000 (21:54 +0200)]
[browser] Enable threads in Wasm SDK (#85109)
Co-authored-by: Aleksey Kliger (λgeek) <akliger@gmail.com>
Fan Yang [Mon, 24 Apr 2023 19:52:25 +0000 (15:52 -0400)]
Add metadata update for overrides (#85182)