platform/upstream/dotnet/runtime.git
18 months agoSplit superpmi-diffs pipeline runs (#84521)
Bruce Forstall [Tue, 11 Apr 2023 15:14:45 +0000 (08:14 -0700)]
Split superpmi-diffs pipeline runs (#84521)

Run tpdiffs and asmdiffs on separate Helix machines, in parallel,
to improve overall job throughput.

18 months agoFix documentation (#84628)
Jonathan [Tue, 11 Apr 2023 14:19:19 +0000 (16:19 +0200)]
Fix documentation (#84628)

18 months ago[mono][eventpipe] fixup DS_EXIT_BLOCKING_PAL_SECTION in checked build (#84455)
Aleksey Kliger (λgeek) [Tue, 11 Apr 2023 14:17:31 +0000 (10:17 -0400)]
[mono][eventpipe] fixup DS_EXIT_BLOCKING_PAL_SECTION in checked build (#84455)

The MONO_EXIT_GC_SAFE macro requires a semicolon after it.  If we
build with -DENABLE_CHECKED_BUILD_GC, MONO_REQ_GC_UNSAFE_MODE expands
to something non-empty, and we get a compilation error due to the
missing separator semicolon.

18 months agoRevert "Revert "Add SIMD to LowerCallMemcmp (#84530)" (#84595)" (#84599)
Egor Bogatov [Tue, 11 Apr 2023 13:07:11 +0000 (15:07 +0200)]
Revert "Revert "Add SIMD to LowerCallMemcmp (#84530)" (#84595)" (#84599)

18 months agoUpdate dependencies from https://github.com/dotnet/roslyn build 20230405.4 (#84422)
dotnet-maestro[bot] [Tue, 11 Apr 2023 12:54:27 +0000 (07:54 -0500)]
Update dependencies from https://github.com/dotnet/roslyn build 20230405.4 (#84422)

Microsoft.CodeAnalysis , Microsoft.CodeAnalysis.CSharp , Microsoft.Net.Compilers.Toolset
 From Version 4.7.0-1.23179.16 -> To Version 4.7.0-1.23205.4

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
18 months agoAdd internal Encoding.TryGetBytes (#84609)
Stephen Toub [Tue, 11 Apr 2023 10:44:16 +0000 (06:44 -0400)]
Add internal Encoding.TryGetBytes (#84609)

18 months ago[wasm] Restrict tests to browser/wasi only. (#84616)
Ilona Tomkowicz [Tue, 11 Apr 2023 10:14:51 +0000 (12:14 +0200)]
[wasm] Restrict tests to browser/wasi only. (#84616)

* Restrict tests to wasm/wasi only.

* Plural, not singular.

18 months agoEnable more general BITCAST folding in local morph (#84144)
SingleAccretion [Tue, 11 Apr 2023 09:30:07 +0000 (12:30 +0300)]
Enable more general BITCAST folding in local morph (#84144)

* Enable the bitcast transform more generally

* Enable general BITCAST support in the backend

Correctness fixes:
1) The hacky way which contained indirections were handled
   will not work for targets where address containment has
   special rules that depends on the type being loaded.
2) Small-typed sources were not handled correctly.
3) Interference checks. This has some regressions attached
   to it because we now contain locals with optimizations
   disabled and that can lead to using double stores instead
   of integer ones when the user is a store itself.

18 months agoJIT: Add a (disabled) prototype for a generalized promotion pass (#83388)
Jakob Botsch Nielsen [Tue, 11 Apr 2023 09:08:28 +0000 (11:08 +0200)]
JIT: Add a (disabled) prototype for a generalized promotion pass (#83388)

Introduce a "physical" promotion pass that generalizes the existing promotion.
More specifically, it does not have restrictions on field count and it can
handle arbitrary recursive promotion.

The pass is physical in the sense that it does not rely on any field metadata
for structs. Instead, it works in two separate passes over the IR:

1. In the first pass we find and analyze how unpromoted struct locals are
accessed. For example, for a simple program like:

```
public static void Main()
{
    S s = default;
    Call(s, s.C);
    Console.WriteLine(s.B + s.C);
}

[MethodImpl(MethodImplOptions.NoInlining)]
private static void Call(S s, byte b)
{
}

private struct S
{
    public byte A, B, C, D, E;
}
```

we see IR like:

```
***** BB01
STMT00000 ( 0x000[E-] ... 0x003 )
               [000003] IA---------                         ▌  ASG       struct (init)
               [000001] D------N---                         ├──▌  LCL_VAR   struct<Program+S, 5> V00 loc0
               [000002] -----------                         └──▌  CNS_INT   int    0

***** BB01
STMT00001 ( 0x008[E-] ... 0x026 )
               [000008] --C-G------                         ▌  CALL      void   Program:Call(Program+S,ubyte)
               [000004] ----------- arg0                    ├──▌  LCL_VAR   struct<Program+S, 5> V00 loc0
               [000007] ----------- arg1                    └──▌  LCL_FLD   ubyte  V00 loc0         [+2]

***** BB01
STMT00002 ( 0x014[E-] ... ??? )
               [000016] --C-G------                         ▌  CALL      void   System.Console:WriteLine(int)
               [000015] ----------- arg0                    └──▌  ADD       int
               [000011] -----------                            ├──▌  LCL_FLD   ubyte  V00 loc0         [+1]
               [000014] -----------                            └──▌  LCL_FLD   ubyte  V00 loc0         [+2]
```

and the analysis produces

```
Accesses for V00
  [000..005)
    #:                             (2, 200)
    # assigned from:               (0, 0)
    # assigned to:                 (1, 100)
    # as call arg:                 (1, 100)
    # as implicit by-ref call arg: (1, 100)
    # as on-stack call arg:        (0, 0)
    # as retbuf:                   (0, 0)
    # as returned value:           (0, 0)

  ubyte @ 001
    #:                             (1, 100)
    # assigned from:               (0, 0)
    # assigned to:                 (0, 0)
    # as call arg:                 (0, 0)
    # as implicit by-ref call arg: (0, 0)
    # as on-stack call arg:        (0, 0)
    # as retbuf:                   (0, 0)
    # as returned value:           (0, 0)

  ubyte @ 002
    #:                             (2, 200)
    # assigned from:               (0, 0)
    # assigned to:                 (0, 0)
    # as call arg:                 (1, 100)
    # as implicit by-ref call arg: (0, 0)
    # as on-stack call arg:        (0, 0)
    # as retbuf:                   (0, 0)
    # as returned value:           (0, 0)
```

Here the pairs are (#ref counts, wtd ref counts).

Based on this accounting, the analysis estimates the profitability of replacing
some of the accessed parts of the struct with a local. This may be costly
because overlapping struct accesses (e.g. passing the whole struct as an
argument) may require more expensive codegen after promotion. And of course,
creating new locals introduces more register pressure. Currently the
profitability analysis is very crude.

In this case the logic decides that promotion is not worth it:

```
Evaluating access ubyte @ 001
  Single write-back cost: 5
  Write backs: 100
  Read backs: 100
  Cost with: 1350
  Cost without: 650
  Disqualifying replacement
Evaluating access ubyte @ 002
  Single write-back cost: 5
  Write backs: 100
  Read backs: 100
  Cost with: 1700
  Cost without: 1300
  Disqualifying replacement
```

2. In the second pass the field accesses are replaced with new locals for the
profitable cases. For overlapping accesses that currently involves writing back
replacements to the struct local first. For arguments/OSR locals, it involves
reading them back from the struct first.

In the above case we can override the profitability analysis with stress mode
STRESS_PHYSICAL_PROMOTION_COST and we get:

```
Evaluating access ubyte @ 001
  Single write-back cost: 5
  Write backs: 100
  Read backs: 100
  Cost with: 1350
  Cost without: 650
  Promoting replacement due to stress

lvaGrabTemp returning 2 (V02 tmp1) (a long lifetime temp) called for V00.[001..002).
Evaluating access ubyte @ 002
  Single write-back cost: 5
  Write backs: 100
  Read backs: 100
  Cost with: 1700
  Cost without: 1300
  Promoting replacement due to stress

lvaGrabTemp returning 3 (V03 tmp2) (a long lifetime temp) called for V00.[002..003).
V00 promoted with 2 replacements
  [001..002) promoted as ubyte V02
  [002..003) promoted as ubyte V03

...

***** BB01
STMT00000 ( 0x000[E-] ... 0x003 )
               [000003] IA---------                         ▌  ASG       struct (init)
               [000001] D------N---                         ├──▌  LCL_VAR   struct<Program+S, 5> V00 loc0
               [000002] -----------                         └──▌  CNS_INT   int    0

***** BB01
STMT00001 ( 0x008[E-] ... 0x026 )
               [000008] -ACXG------                         ▌  CALL      void   Program:Call(Program+S,ubyte)
               [000004] ----------- arg0                    ├──▌  LCL_VAR   struct<Program+S, 5> V00 loc0
               [000022] -A--------- arg1                    └──▌  COMMA     ubyte
               [000021] -A---------                            ├──▌  ASG       ubyte
               [000019] D------N---                            │  ├──▌  LCL_VAR   ubyte  V03 tmp2
               [000020] -----------                            │  └──▌  LCL_FLD   ubyte  V00 loc0         [+2]
               [000018] -----------                            └──▌  LCL_VAR   ubyte  V03 tmp2

***** BB01
STMT00002 ( 0x014[E-] ... ??? )
               [000016] -ACXG------                         ▌  CALL      void   System.Console:WriteLine(int)
               [000015] -A--------- arg0                    └──▌  ADD       int
               [000027] -A---------                            ├──▌  COMMA     ubyte
               [000026] -A---------                            │  ├──▌  ASG       ubyte
               [000024] D------N---                            │  │  ├──▌  LCL_VAR   ubyte  V02 tmp1
               [000025] -----------                            │  │  └──▌  LCL_FLD   ubyte  V00 loc0         [+1]
               [000023] -----------                            │  └──▌  LCL_VAR   ubyte  V02 tmp1
               [000028] -----------                            └──▌  LCL_VAR   ubyte  V03 tmp2
```

The pass still only has rudimentary support and is missing many basic CQ
optimization optimizations. For example, it does not make use of any liveness
yet and it does not have any decomposition support for assignments. Yet, it
already shows good potential in user benchmarks. I have listed some follow-up
improvements in #76928.

This PR is adding the pass but it is disabled by default. It can be enabled by
setting DOTNET_JitStressModeNames=STRESS_PHYSICAL_PROMOTION. There are two new
scenarios added to jit-experimental that enables it, to be used for testing
purposes.

18 months ago[clr][RISC-V] Fix build fail (#84608)
Dong-Heon Jung [Tue, 11 Apr 2023 09:05:47 +0000 (18:05 +0900)]
[clr][RISC-V] Fix build fail (#84608)

- Failed due to https://github.com/dotnet/runtime/pull/84221

18 months agoObsolete most of the remaining legacy serialization APIs (#84383)
Levi Broderick [Tue, 11 Apr 2023 05:52:15 +0000 (22:52 -0700)]
Obsolete most of the remaining legacy serialization APIs (#84383)

- Move BinaryFormatter obsoletions to type-level
- Introduce SYSLIB0050 and SYSLIB0051 obsoletion waves
- Remove some dead code

Ref: https://github.com/dotnet/designs/pull/293

18 months agodotnet.exe prints error messages to console when launched with empty DOTNET_MULTILEVE...
Badre BSAILA [Tue, 11 Apr 2023 03:31:16 +0000 (05:31 +0200)]
dotnet.exe prints error messages to console when launched with empty DOTNET_MULTILEVEL_LOOKUP (#84322)

18 months agoUpdate dependencies from https://github.com/dotnet/arcade build 20230405.4 (#84420)
dotnet-maestro[bot] [Tue, 11 Apr 2023 03:20:56 +0000 (22:20 -0500)]
Update dependencies from https://github.com/dotnet/arcade build 20230405.4 (#84420)

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.23177.4 -> To Version 8.0.0-beta.23205.4

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
18 months agoDelete `GT_OBJ` (#84221)
SingleAccretion [Tue, 11 Apr 2023 01:47:49 +0000 (04:47 +0300)]
Delete `GT_OBJ` (#84221)

* Delete dependencies on the handle from OBJ

* Delete GT_OBJ

GT_OBJ and GT_OBJ both represent struct loads. There is no need to have two.

Delete GT_OBJ as the more derived one.

* gtNewObjNode -> gtNewBlkIndir

* Fix up RISC-V

18 months agoadd msquic to debug runtime on macOS (#84181)
Tomas Weinfurt [Tue, 11 Apr 2023 01:13:25 +0000 (18:13 -0700)]
add msquic to debug runtime on macOS (#84181)

* add msquic to debug runtime on macOS

* update

* update

* PlatformManifestFileEntry

* update

* packaging

* feedback from review

* LibrariesConfiguration

18 months agoRevert "Add SIMD to LowerCallMemcmp (#84530)" (#84595)
Sven Boemer [Tue, 11 Apr 2023 00:48:48 +0000 (17:48 -0700)]
Revert "Add SIMD to LowerCallMemcmp (#84530)" (#84595)

This reverts commit eda1c3a41f1493defbb026a35de76acd4ccbeb0a.

18 months agoAdding support for Vector512 `Equals`, `EqualsAny`, `op_Equality`, and `op_Inequality...
anthonycanino [Mon, 10 Apr 2023 23:27:23 +0000 (16:27 -0700)]
Adding support for Vector512 `Equals`, `EqualsAny`, `op_Equality`, and `op_Inequality`. (#83470)

* Implement `Vector512.Equals` by way of special `AVX512` intrinsic.

* Add Vector512 `Equals`, `EqualsAll/op_Equality` `op_Inequality`.

* Fix `vpmovm2x` instructions for `MoveMaskToVectorSpecial`.

* Move `Vector512` Equals into `gtNewSimdCmpOpNode`.

* Adds `EqualsAny`.

* Fix `kortestq` and `kortestd` opcode gen (W bit).

* Fix merge and update instr flags.

* Addressing review comments.

* Removing unnecessary files.

* Addressing review comments.

* Fixing bug.

* Fixing k reg display on x86.

* Setting Resets_ZF to right value.

* Fixing extract.

---------

Co-authored-by: Deepak Rajendrakumaran <deepak.rajendrakumaran@intel.com>
Co-authored-by: Tanner Gooding <tagoo@outlook.com>
18 months ago[jiterp] Move the backbranch flag to a local that is only flushed on abnormal trace...
Katelyn Gadd [Mon, 10 Apr 2023 23:02:55 +0000 (16:02 -0700)]
[jiterp] Move the backbranch flag to a local that is only flushed on abnormal trace exit (#84585)

18 months ago[jiterp] Move the backbranch flag to a local that is only flushed on abnormal trace...
Katelyn Gadd [Mon, 10 Apr 2023 23:02:38 +0000 (16:02 -0700)]
[jiterp] Move the backbranch flag to a local that is only flushed on abnormal trace exit (#84585)

18 months agoAdd SIMD to LowerCallMemcmp (#84530)
Egor Bogatov [Mon, 10 Apr 2023 22:56:43 +0000 (00:56 +0200)]
Add SIMD to LowerCallMemcmp (#84530)

18 months agoAdd SPMI benchmarks run collections for tiered and tiered pgo (#84483)
Andy Ayers [Mon, 10 Apr 2023 22:33:21 +0000 (15:33 -0700)]
Add SPMI benchmarks run collections for tiered and tiered pgo (#84483)

Add two new run configurations for SPMI benchmarks: tiered and tiered pgo.
So benchmark runs now have 3 separate collections.

The new ones are named "run_tiered" and "run_pgo", eg

```
benchmarks.run.windows.x64.checked.mch
benchmarks.run_tiered.windows.x64.checked.mch
benchmarks.run_pgo.windows.x64.checked.mch
```

18 months agoImplement IUtf8SpanFormattable on IPAddress and IPNetwork (#84487)
Stephen Toub [Mon, 10 Apr 2023 20:15:35 +0000 (16:15 -0400)]
Implement IUtf8SpanFormattable on IPAddress and IPNetwork (#84487)

* Implement IUtf8SpanFormattable on IPAddress and IPNetwork

Implements IUtf8SpanFormattable explicitly on both IPAddress and IPNetwork.  For IPNetwork, we just use Utf8.TryWrite just as the existing ISpanFormattable uses MemoryExtensions.TryWrite.  For IPAddress, the existing formatting code is made to work generically for either byte or char.

In the process, I removed the unsafe pointer-based code from the formatting logic while also making it faster.

* Fix parameter names

18 months agoDisable TestCurrentValueDoesNotAllocateOnceValueIsCached on mono (#84571)
Larry Ewing [Mon, 10 Apr 2023 19:46:49 +0000 (14:46 -0500)]
Disable TestCurrentValueDoesNotAllocateOnceValueIsCached on mono (#84571)

18 months agoUpdate implementation of optUpdateLoopsBeforeRemoveBlock (#84511)
Bruce Forstall [Mon, 10 Apr 2023 17:02:03 +0000 (10:02 -0700)]
Update implementation of optUpdateLoopsBeforeRemoveBlock (#84511)

Use predecessor lists and the successor iterator.

18 months agoImprove regex compiler / source generator for sets (#84370)
Stephen Toub [Mon, 10 Apr 2023 16:31:44 +0000 (12:31 -0400)]
Improve regex compiler / source generator for sets (#84370)

* Fix downlevel builds with a project reference to regex generator

* Improve char class canonicalization for complete and almost empty sets

- Remove categories from a set whose ranges make it already complete (when there's no subtraction).  We have code paths that explicitly recognize the Any char class, and these extra categories knock these sets off those fast paths.
- Remove categories from a set where a single char is missing from the ranges, by checking whether that char is contained in the categories.  If the char is present, the set can be morphed into Any.  If the char isn't present, the categories can be removed and the set becomes a standard NotOne form.

Both of these are unlikely to be written explicitly by a developer but result from analysis producing search sets, in particular when alternations or nullable loops are involved.

Also fixed textual description of sets that both contain the last character (\uFFFF) and have categories.  We were sometimes skipping the first category in this case.  This is only relevant to the source generator, as these descriptions are output in comments.

* Avoid using a IndexOf for the any set

We needn't search for anything, as everything matches.

* Improve regex source gen IndexOfAny naming for Unicode categories

When we're otherwise unable to come up with a good name for the custom IndexOfAny helper, if the set is just a handful of UnicodeCategory values, derive a name from those categories.

* Reduce RegexCompiler cost of using IndexOfAnyValues

With the source generator, each IndexOfAnyValues is stored in its own static readonly field.  This makes it cheap to access and allows the JIT to devirtualize calls to it.

With RegexCompiler, we use a DynamicMethod and thus can't introduce new static fields, so instead we maintain an array of IndexOfAnyValues.  That means that every time we need one, we're loading the object out of the array.  This incurs both bounds checks and doesn't devirtualize.

This commit changes the implementation to avoid the bounds check and to also enable devirtualization.

18 months agoFix minor jitdisasm issue (#84548)
Egor Bogatov [Mon, 10 Apr 2023 16:04:58 +0000 (18:04 +0200)]
Fix minor jitdisasm issue (#84548)

18 months ago[main] Update dependencies from 10 repositories (#83624)
dotnet-maestro[bot] [Mon, 10 Apr 2023 15:50:03 +0000 (11:50 -0400)]
[main] Update dependencies from 10 repositories (#83624)

* Update dependencies from https://github.com/dotnet/llvm-project build 20230317.1

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.23165.1 -> To Version 14.0.0-alpha.1.23167.1

* Update dependencies from https://dev.azure.com/dnceng/internal/_git/dotnet-optimization build 20230317.4

optimization.linux-arm64.MIBC.Runtime , optimization.linux-x64.MIBC.Runtime , optimization.windows_nt-arm64.MIBC.Runtime , optimization.windows_nt-x64.MIBC.Runtime , optimization.windows_nt-x86.MIBC.Runtime , optimization.PGO.CoreCLR
 From Version 1.0.0-prerelease.23166.4 -> To Version 1.0.0-prerelease.23167.4

* Update dependencies from https://github.com/dotnet/icu build 20230317.1

Microsoft.NETCore.Runtime.ICU.Transport
 From Version 8.0.0-preview.3.23163.3 -> To Version 8.0.0-preview.3.23167.1

* Update dependencies from https://github.com/dotnet/emsdk build 20230317.2

Microsoft.NET.Workload.Emscripten.Current.Manifest-8.0.100.Transport
 From Version 8.0.0-preview.3.23167.1 -> To Version 8.0.0-preview.3.23167.2

* Update dependencies from https://github.com/dotnet/runtime build 20230320.1

Microsoft.NET.ILLink.Tasks , Microsoft.NET.Sdk.IL , Microsoft.NETCore.App.Runtime.win-x64 , Microsoft.NETCore.ILAsm , runtime.native.System.IO.Ports , System.Text.Json
 From Version 8.0.0-preview.3.23162.2 -> To Version 8.0.0-preview.3.23170.1

* Update dependencies from https://github.com/dotnet/emsdk build 20230320.1

Microsoft.NET.Workload.Emscripten.Current.Manifest-8.0.100.Transport
 From Version 8.0.0-preview.3.23167.1 -> To Version 8.0.0-preview.4.23170.1

* Update dependencies from https://github.com/dotnet/llvm-project build 20230320.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.23165.1 -> To Version 14.0.0-alpha.1.23170.2

* Update dependencies from https://github.com/dotnet/llvm-project build 20230320.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.23165.1 -> To Version 14.0.0-alpha.1.23170.3

* Update dependencies from https://dev.azure.com/dnceng/internal/_git/dotnet-optimization build 20230320.4

optimization.linux-arm64.MIBC.Runtime , optimization.linux-x64.MIBC.Runtime , optimization.windows_nt-arm64.MIBC.Runtime , optimization.windows_nt-x64.MIBC.Runtime , optimization.windows_nt-x86.MIBC.Runtime , optimization.PGO.CoreCLR
 From Version 1.0.0-prerelease.23166.4 -> To Version 1.0.0-prerelease.23170.4

* Update dependencies from https://github.com/dotnet/icu build 20230320.4

Microsoft.NETCore.Runtime.ICU.Transport
 From Version 8.0.0-preview.3.23163.3 -> To Version 8.0.0-preview.4.23170.4

* Update dependencies from https://github.com/dotnet/msquic build 20230320.1

System.Net.MsQuic.Transport
 From Version 8.0.0-alpha.1.23166.1 -> To Version 8.0.0-alpha.1.23170.1

* Update dependencies from https://github.com/dotnet/cecil build 20230320.1

Microsoft.DotNet.Cecil
 From Version 0.11.4-alpha.23163.1 -> To Version 0.11.4-alpha.23170.1

* Update dependencies from https://github.com/dotnet/llvm-project build 20230321.1

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.23165.1 -> To Version 14.0.0-alpha.1.23171.1

* Update dependencies from https://github.com/dotnet/llvm-project build 20230321.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.23165.1 -> To Version 14.0.0-alpha.1.23171.2

* Update dependencies from https://dev.azure.com/dnceng/internal/_git/dotnet-optimization build 20230322.10

optimization.linux-arm64.MIBC.Runtime , optimization.linux-x64.MIBC.Runtime , optimization.windows_nt-arm64.MIBC.Runtime , optimization.windows_nt-x64.MIBC.Runtime , optimization.windows_nt-x86.MIBC.Runtime , optimization.PGO.CoreCLR
 From Version 1.0.0-prerelease.23166.4 -> To Version 1.0.0-prerelease.23172.10

* Update dependencies from https://github.com/dotnet/emsdk build 20230322.1

Microsoft.NET.Workload.Emscripten.Current.Manifest-8.0.100.Transport
 From Version 8.0.0-preview.4.23170.1 -> To Version 8.0.0-preview.4.23172.1

* Update dependencies from https://dev.azure.com/dnceng/internal/_git/dotnet-optimization build 20230323.4

optimization.linux-arm64.MIBC.Runtime , optimization.linux-x64.MIBC.Runtime , optimization.windows_nt-arm64.MIBC.Runtime , optimization.windows_nt-x64.MIBC.Runtime , optimization.windows_nt-x86.MIBC.Runtime , optimization.PGO.CoreCLR
 From Version 1.0.0-prerelease.23166.4 -> To Version 1.0.0-prerelease.23173.4

* Update dependencies from https://github.com/dotnet/xharness build 20230323.1

Microsoft.DotNet.XHarness.CLI , Microsoft.DotNet.XHarness.TestRunners.Common , Microsoft.DotNet.XHarness.TestRunners.Xunit
 From Version 1.0.0-prerelease.23163.1 -> To Version 1.0.0-prerelease.23173.1

* Update dependencies from https://github.com/dotnet/runtime-assets build 20230323.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.23163.1 -> To Version 8.0.0-beta.23173.1

* Update dependencies from https://dev.azure.com/dnceng/internal/_git/dotnet-optimization build 20230324.4

optimization.linux-arm64.MIBC.Runtime , optimization.linux-x64.MIBC.Runtime , optimization.windows_nt-arm64.MIBC.Runtime , optimization.windows_nt-x64.MIBC.Runtime , optimization.windows_nt-x86.MIBC.Runtime , optimization.PGO.CoreCLR
 From Version 1.0.0-prerelease.23166.4 -> To Version 1.0.0-prerelease.23174.4

* Update dependencies from https://github.com/dotnet/msquic build 20230324.1

System.Net.MsQuic.Transport
 From Version 8.0.0-alpha.1.23166.1 -> To Version 8.0.0-alpha.1.23174.1

* Update dependencies from https://dev.azure.com/dnceng/internal/_git/dotnet-optimization build 20230325.4

optimization.linux-arm64.MIBC.Runtime , optimization.linux-x64.MIBC.Runtime , optimization.windows_nt-arm64.MIBC.Runtime , optimization.windows_nt-x64.MIBC.Runtime , optimization.windows_nt-x86.MIBC.Runtime , optimization.PGO.CoreCLR
 From Version 1.0.0-prerelease.23166.4 -> To Version 1.0.0-prerelease.23175.4

* Update dependencies from https://github.com/dotnet/runtime build 20230327.1

Microsoft.NET.ILLink.Tasks , Microsoft.NET.Sdk.IL , Microsoft.NETCore.App.Runtime.win-x64 , Microsoft.NETCore.ILAsm , runtime.native.System.IO.Ports , System.Text.Json
 From Version 8.0.0-preview.3.23162.2 -> To Version 8.0.0-preview.4.23177.1

* Update dependencies from https://github.com/dotnet/emsdk build 20230327.1

Microsoft.NET.Workload.Emscripten.Current.Manifest-8.0.100.Transport
 From Version 8.0.0-preview.4.23170.1 -> To Version 8.0.0-preview.4.23177.1

* Update dependencies from https://github.com/dotnet/xharness build 20230328.2

Microsoft.DotNet.XHarness.CLI , Microsoft.DotNet.XHarness.TestRunners.Common , Microsoft.DotNet.XHarness.TestRunners.Xunit
 From Version 1.0.0-prerelease.23163.1 -> To Version 1.0.0-prerelease.23178.2

* Update dependencies from https://github.com/dotnet/emsdk build 20230328.1

Microsoft.NET.Workload.Emscripten.Current.Manifest-8.0.100.Transport
 From Version 8.0.0-preview.4.23170.1 -> To Version 8.0.0-preview.4.23178.1

* Update dependencies from https://github.com/dotnet/cecil build 20230328.1

Microsoft.DotNet.Cecil
 From Version 0.11.4-alpha.23163.1 -> To Version 0.11.4-alpha.23178.1

* Update dependencies from https://github.com/dotnet/llvm-project build 20230327.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.23165.1 -> To Version 14.0.0-alpha.1.23177.2

* Update dependencies from https://github.com/dotnet/llvm-project build 20230329.1

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.23165.1 -> To Version 14.0.0-alpha.1.23179.1

* Update dependencies from https://github.com/dotnet/runtime-assets build 20230329.4

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.23163.1 -> To Version 8.0.0-beta.23179.4

* Update dependencies from https://github.com/dotnet/msquic build 20230329.1

System.Net.MsQuic.Transport
 From Version 8.0.0-alpha.1.23166.1 -> To Version 8.0.0-alpha.1.23179.1

* Update dependencies from https://github.com/dotnet/hotreload-utils build 20230329.3

Microsoft.DotNet.HotReload.Utils.Generator.BuildTool
 From Version 1.1.0-alpha.0.23156.1 -> To Version 1.1.0-alpha.0.23179.3

* Rollback dotnet/msquic changes

* Update dependencies from https://github.com/dotnet/emsdk build 20230405.3

Microsoft.NET.Workload.Emscripten.Current.Manifest-8.0.100.Transport
 From Version 8.0.0-preview.4.23170.1 -> To Version 8.0.0-preview.4.23205.3

* Update dependencies from https://github.com/dotnet/icu build 20230403.1

Microsoft.NETCore.Runtime.ICU.Transport
 From Version 8.0.0-preview.3.23163.3 -> To Version 8.0.0-preview.4.23203.1

* Update dependencies from https://github.com/dotnet/msquic build 20230331.1

System.Net.MsQuic.Transport
 From Version 8.0.0-alpha.1.23166.1 -> To Version 8.0.0-alpha.1.23181.1

* Revert "Update dependencies from https://github.com/dotnet/msquic build 20230331.1"

This reverts commit 11b80419169153fa820197f96443c22b6f2a5665.

---------

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Larry Ewing <lewing@microsoft.com>
Co-authored-by: Natalia Kondratyeva <knatalia@microsoft.com>
Co-authored-by: Eric StJohn <ericstj@microsoft.com>
18 months agoDelete `gtGetStructHandle` and friends (#84212)
SingleAccretion [Mon, 10 Apr 2023 14:54:36 +0000 (17:54 +0300)]
Delete `gtGetStructHandle` and friends (#84212)

* Delete gtGetStructHandle[IfPresent]

Replaced with GenTree::GetLayout.

* Delete the canonical handle logic

* Delete handle handling from fgMakeMultiUse

* Delete gtGetStructHandleForSIMD and friends

* Delete now-unused SIMD cache entries

* Fix SIMD

* Fix fgMakeMultiUse

* Delete the IsSimdAsHWIntrinsic logic

No longer needed.

* Fix formatting

18 months agoImplement IUtf8SpanFormattable on Version (#84556)
Stephen Toub [Mon, 10 Apr 2023 13:33:42 +0000 (09:33 -0400)]
Implement IUtf8SpanFormattable on Version (#84556)

18 months agoApply the TimeProvider design feedback (#84501)
Tarek Mahmoud Sayed [Sun, 9 Apr 2023 23:04:55 +0000 (16:04 -0700)]
Apply the TimeProvider design feedback (#84501)

18 months agoJIT: scalable profile counter mode (#84427)
Andy Ayers [Sun, 9 Apr 2023 21:22:58 +0000 (14:22 -0700)]
JIT: scalable profile counter mode (#84427)

Add an config option to use a "scalable" profile helper for edge counters,
where we try and avoid contention by probablistic updates once the counter
value exceeds some threshold (currently 8192). Using the current xorshift
RNG this gives the counter a two-sigma accuracy of around +/- 2%.

The idea is loosely based on "Scalable Statistics Counters" by Dice, Lev,
and Moir (SPAA’13).

Also allow the scalable and interlocked profile modes to operate at the same
time, recording two sets of counts per probe, so we can verify that this new mode
is sufficiently accurate.

18 months agofix Kernel32.GetSystemTimes usage on Windows (#84526)
Sergey Anisimov [Sun, 9 Apr 2023 19:17:29 +0000 (05:17 +1000)]
fix Kernel32.GetSystemTimes usage on Windows (#84526)

18 months agoEnable AVX-512 in Memmove unrolling (#84348)
Egor Bogatov [Sun, 9 Apr 2023 18:36:53 +0000 (20:36 +0200)]
Enable AVX-512 in Memmove unrolling (#84348)

18 months agoEnsure loops respect dominators (#84458)
Bruce Forstall [Sun, 9 Apr 2023 17:39:24 +0000 (10:39 -0700)]
Ensure loops respect dominators (#84458)

* Improve recognized loop invariants

When a loop has a single exit, the loop table stores a pointer to
the loop exit block. Ideally, we would have the property that the
loop entry block dominates the single exit block, and you could
thus walk up the IDom list from the exit the the entry block.

A peculiar loop structure on x86 only was preventing this: an "infinite"
loop with a "try/catch" where the only "exit" was from the "catch"
handler. For non-x86, the handler would have been moved out-of-line
as a funclet. But for x86, the handler is still in-line with the
loop blocks. This structure is peculiar because the catch handler
has no predecessors and doesn't participate "normally" in the dominator
tree.

Prevent handler blocks like this from being considered loop exits.

* Formatting

18 months agoSimplify target to enable config binding src generator from NuGet package, ensure...
Layomi Akinrinade [Sun, 9 Apr 2023 17:34:15 +0000 (10:34 -0700)]
Simplify target to enable config binding src generator from NuGet package, ensure it runs for all TFMs, and rename enabling property (#84379)

* Simplify target to enable config binding src generator and rename sentinel property

* Further simplify target

* Address feedback

* Ensure generator removal target is for all TFMs

* Add logic to emit correct recommended minimum TFM

19 months agoFix IUtf8SpanFormattable.TryFormat argument name (#84535)
Stephen Toub [Sun, 9 Apr 2023 13:58:52 +0000 (09:58 -0400)]
Fix IUtf8SpanFormattable.TryFormat argument name (#84535)

The approved parameter name was `utf8Destination` rather than just `destination`.

19 months agoImplement IUtf8SpanFormattable on DateTime, DateTimeOffset, DateOnly, TimeOnly, TimeS...
Stephen Toub [Sun, 9 Apr 2023 11:24:15 +0000 (07:24 -0400)]
Implement IUtf8SpanFormattable on DateTime, DateTimeOffset, DateOnly, TimeOnly, TimeSpan, Char, Rune (#84469)

* Implement IUtf8SpanFormattable on DateTime, DateTimeOffset, DateOnly, TimeOnly, TimeSpan, Char, Rune

* Address PR feedback

Also dedup Utf8Formatter for TimeSpan with TimeSpan's new IUtf8SpanFormattable implementation and a little more cleanup.

And fix parameter name of TryFormat to match approved name.

19 months agoUpdating the JIT to support Narrow, WidenLower, and WidenUpper for Vector512 (#84498)
Tanner Gooding [Sun, 9 Apr 2023 04:09:45 +0000 (21:09 -0700)]
Updating the JIT to support Narrow, WidenLower, and WidenUpper for Vector512 (#84498)

* Updating the JIT to support Narrow, WidenLower, and WidenUpper for Vector512

* Ensure tgtReg is passed in the RM slot for the AVX512 narrowing instructions

* Applying formatting patch

* Update src/coreclr/jit/lowerxarch.cpp

19 months agoAvx512 arithmetic (#84429)
Jyothi Krishna V S [Sun, 9 Apr 2023 01:38:49 +0000 (18:38 -0700)]
Avx512 arithmetic (#84429)

* Add and Subtract support for AVX512

* Removing absovled condition

* fixing formatting issues

* Addressing review comments,
Using non saturation version for add.

* Update src/coreclr/jit/hwintrinsiclistxarch.h

Co-authored-by: Tanner Gooding <tagoo@outlook.com>
---------

Co-authored-by: Tanner Gooding <tagoo@outlook.com>
19 months agoPerform ldr to ldp peephole optimization (#84399)
Kunal Pathak [Sat, 8 Apr 2023 21:16:19 +0000 (14:16 -0700)]
Perform ldr to ldp peephole optimization (#84399)

* Perform ldr to ldp peephole optimization

* jit format

* handle non-gc str cases

* Add the comment

19 months ago[RISC-V] coreclr-jit directory (#82379)
Dong-Heon Jung [Sat, 8 Apr 2023 18:29:53 +0000 (03:29 +0900)]
[RISC-V] coreclr-jit directory (#82379)

* [RISCV-V] coreclr-jit directory

- Successfully cross-build for RISC-V.
- Run A simple application "helloworld"
- Fail a test in clr.paltest

* Fix in jit/CMakeLists.txt

* Tidy up by jit-format

* Add a emitIns_S_R_R to handling more temporary reg

* Fix jit code format

* Fix

* [JIT] Fix test

* [JIT] Updated

* [JIT] JitFormat

* [JIT] Enable IsImplicitByrefParameterValuePostMorph

* [JIT] Update

- Use rsGetRsvdReg
- Remove unnecessary codes

* [JIT] Replace to RISCV64

I implemented based on LOONGARCH.
Some comments in the codes are not updated yet.

* [JIT] Update emitter and fix bugs

* [JIT] Fix a build error (remove GT_ADDR)

* [JIT] FIX BUILD ERROR

- Remove GTF_BLK_VOLATILE
- Replace GT_LCL_VAR_ADDR and GT_LCL_FLD_ADDR with GT_LCL_ADDR

* [JIT] Update by reviews

* [JIT] Update JCMP and fix related errors

* [JIT] Add NYI

* [JIT] Add getRISCV64PassStructInRegisterFlags

* [JIT] Remove constant handling in genRangeCheck

* [VM] Add getRISCV64PassStructInRegisterFlags

* [VM] Update JITEEVersionIdentifier

19 months agoUpdate enabledisable.csproj (#84506)
David Mason [Sat, 8 Apr 2023 15:10:58 +0000 (08:10 -0700)]
Update enabledisable.csproj (#84506)

19 months agoNativeAOT: Partially expand static initialization (#83911)
Egor Bogatov [Sat, 8 Apr 2023 08:10:53 +0000 (10:10 +0200)]
NativeAOT: Partially expand static initialization (#83911)

Co-authored-by: Jan Kotas <jkotas@microsoft.com>
Co-authored-by: SingleAccretion <62474226+SingleAccretion@users.noreply.github.com>
19 months agoWrite linker script for lld to enable gc-sections (#84493)
Adeel Mujahid [Sat, 8 Apr 2023 03:09:32 +0000 (06:09 +0300)]
Write linker script for lld to enable gc-sections (#84493)

19 months ago[mono] [RISC-V] re-implement floating point arithmetic without r4fp (#84470)
VincentWu [Sat, 8 Apr 2023 02:20:33 +0000 (10:20 +0800)]
[mono] [RISC-V] re-implement floating point arithmetic without r4fp (#84470)

* fix no r4fp

* format

* defined MONO_ARCH_FLOAT32_SUPPORTED

19 months agoReenable VectorLookup tests for mono. (#84330)
Zoltan Varga [Sat, 8 Apr 2023 01:46:22 +0000 (21:46 -0400)]
Reenable VectorLookup tests for mono. (#84330)

19 months agoAllow multiple EventCounters sessions and make sure EventListeners always send a...
David Mason [Sat, 8 Apr 2023 00:25:01 +0000 (17:25 -0700)]
Allow multiple EventCounters sessions and make sure EventListeners always send a Disable command (#82970)

19 months ago[ComInterfaceGenerator] Strip public keyword from managedToNative stub (#84496)
Jackson Schuster [Fri, 7 Apr 2023 23:52:19 +0000 (18:52 -0500)]
[ComInterfaceGenerator] Strip public keyword from managedToNative stub (#84496)

19 months agotypo fix (#84485)
Nicholas Orlowsky [Fri, 7 Apr 2023 22:17:30 +0000 (17:17 -0500)]
typo fix (#84485)

19 months agoIntroduce BBJ_EHFAULTRET (#84467)
Bruce Forstall [Fri, 7 Apr 2023 21:56:17 +0000 (14:56 -0700)]
Introduce BBJ_EHFAULTRET (#84467)

The IL `endfinally` and `endfault` instructions are aliases,
imported in the JIT IR as `BBJ_EHFINALLYRET`.

Introduce `BBJ_EHFAULTRET` for cases within `fault` clauses.

This simplifies some code, and makes it more clear when writing
code that `fault` clauses need to be considered, separately from
`finally` clauses.

To do this, after importing EH clauses, convert any `BBJ_EHFINALLYRET`
as necessary. Also, try/finally cloning, which (sometimes) converts
`finally` clauses to `fault` clauses, needs to update the corresponding
`BBJ_EHFINALLYRET`. When creating new try/fault clauses for synchronized
functions, use `BBJ_EHFAULTRET` now.

Fixes #84307

19 months agoDerived Interface support in ComInterfaceGenerator (#84271)
Jeremy Koritzinsky [Fri, 7 Apr 2023 21:12:04 +0000 (14:12 -0700)]
Derived Interface support in ComInterfaceGenerator (#84271)

19 months ago[mono][sgen] Remove more dead code (#84476)
Vlad Brezae [Fri, 7 Apr 2023 21:10:49 +0000 (00:10 +0300)]
[mono][sgen] Remove more dead code (#84476)

19 months agoJIT: Avoid unnecessary GTF_GLOB_REFs (#84349)
Jakob Botsch Nielsen [Fri, 7 Apr 2023 19:05:26 +0000 (21:05 +0200)]
JIT: Avoid unnecessary GTF_GLOB_REFs (#84349)

* Avoid setting GTF_GLOB_REF on GT_FIELD_ADDR nodes
* Avoid setting GTF_GLOB_REF on GT_FIELD nodes off of implicit byrefs.
  This is ok now since implicit byref morphing indiscriminately sets
  GTF_GLOB_REF for these.
* Manually clone a "pointer to span" in span intrinsic expansion when it points to a local. Unfortunately this does not fall out from the above since gtClone does not handle FIELD_ADDR, and making it handle this needs some more work.

These changes are necessary to avoid address exposure in the two user
benchmarks in #83388.

Fix #74563
Fix #856

19 months agoUse a tuned ConcurrentDictionary in the default caching implementation for the COM...
Jeremy Koritzinsky [Fri, 7 Apr 2023 18:09:56 +0000 (11:09 -0700)]
Use a tuned ConcurrentDictionary in the default caching implementation for the COM source generator (#84335)

19 months agoAdd a test for warning behavior of Requires on type with a const field (#84452)
Vitek Karas [Fri, 7 Apr 2023 15:57:10 +0000 (08:57 -0700)]
Add a test for warning behavior of Requires on type with a const field (#84452)

The IL tools (illink, ilc) don't see const field references in code, since the compiler inlines the values. But analyzer does see them. If the const field is on a type with Requires attribute, that access is reported as a warning, which is only produced by the analyzer.

This adds tests for these cases, no product changes.

Tests for https://github.com/dotnet/runtime/issues/84433

19 months agoMake service wait on its state before stopping (#84447)
Eric StJohn [Fri, 7 Apr 2023 15:28:37 +0000 (08:28 -0700)]
Make service wait on its state before stopping (#84447)

19 months ago[mono] Fix build error due to undeclared identifier 'llvm' (#84473)
Alexander Köplinger [Fri, 7 Apr 2023 14:04:00 +0000 (16:04 +0200)]
[mono] Fix build error due to undeclared identifier 'llvm' (#84473)

`llvm` is only declared when ENABLE_LLVM is defined.

19 months agoMitigation for #84446: comment out problematic JIT assertion check (#84449)
Tomáš Rylek [Fri, 7 Apr 2023 07:53:47 +0000 (09:53 +0200)]
Mitigation for #84446: comment out problematic JIT assertion check (#84449)

The most recent aggregated runtime MIBC optimization data contains
a combination of block and edge counts, possibly after a change
from January 2023 that switched MIBC logic over from using block
counts to edge counts. The offending assertion check wasn't expecting
it and started crashing Crossgen2 during compilation of
System.Private.CoreLib on Windows x64 / arm. Based on Andy Ayers'
advice I'm proposing to comment out the assertion check; I have
created the tracking issue #84446 to follow up on consolidation of
JIT and MIBC production logic in this respect.

Thanks

Tomas

19 months ago[browser][non-icu] `HybridGlobalization` compare (#84249)
Ilona Tomkowicz [Fri, 7 Apr 2023 07:04:32 +0000 (09:04 +0200)]
[browser][non-icu] `HybridGlobalization` compare (#84249)

* Added support for hybrid globalization comparison.

* Clean-up. Added exception test cases to docs.

* Nit changes from @kg's review.

* Applied @kg's review.

* Revert unintentional change.

* Refactor: all hybrid globalization js methods in one file.

* Color the syntax.

* Undeline the fact that this PR is only for WASM.

* Move interop functions to proper location.

19 months agoShrink hello world by 3.2% (#84463)
Michal Strehovský [Fri, 7 Apr 2023 06:04:01 +0000 (15:04 +0900)]
Shrink hello world by 3.2% (#84463)

* Get rid of the MethodTable for double/float
* Get rid of any `Array<T>` methods

19 months ago[NativeAOT] Using the same CastCache implementation as in CoreClr (#84430)
Vladimir Sadov [Fri, 7 Apr 2023 02:04:47 +0000 (19:04 -0700)]
[NativeAOT] Using the same CastCache implementation as in CoreClr (#84430)

* Getter

* different limits on debug/release

* tweaks

* remove now unnecessary CrstCastCache

* implement flushing

* move coreclr castcache to a separate file

* Unified CastCache implementation

* comments and cleanups

* couple more cleanups

* trivial implementation of the cast cache for the Test.Corlib

* use Numerics.BitOperations for bit math

19 months agoIntroducing Time abstraction Part2 (down-level support) (#84235)
Tarek Mahmoud Sayed [Fri, 7 Apr 2023 01:59:03 +0000 (18:59 -0700)]
Introducing Time abstraction Part2 (down-level support) (#84235)

19 months agoSimplify numasupport (#84207)
Adeel Mujahid [Thu, 6 Apr 2023 23:23:56 +0000 (02:23 +0300)]
Simplify numasupport (#84207)

* Simplify numasupport

* short-circuit

* Cleanup from QUIC readme

* Address CR feedback: early bail for < 2 NUMA nodes

* Fix node numbering, which is 0-based

19 months agoAdded the ability to specify a Spin Count Unit via a GC Configuration
Mukund Raghav Sharma (Moko) [Thu, 6 Apr 2023 22:56:05 +0000 (15:56 -0700)]
Added the ability to specify a Spin Count Unit via a GC Configuration

Added the ability to specify a Spin Count Unit via a GC Configuration and make use of this value in the SetYieldProcessorScalingFactor function if the value is valid. If this configuration is not specified, we default to 0 and fall back to the original logic.

19 months agoMove startup hook tests targeting `StartupHookProvider` out of hosting tests (#84338)
Elinor Fung [Thu, 6 Apr 2023 22:36:03 +0000 (15:36 -0700)]
Move startup hook tests targeting `StartupHookProvider` out of hosting tests (#84338)

19 months agoJIT: Set GTF_DEBUG_NODE_MORPHED properly in block morph (#84352)
Jakob Botsch Nielsen [Thu, 6 Apr 2023 22:05:19 +0000 (00:05 +0200)]
JIT: Set GTF_DEBUG_NODE_MORPHED properly in block morph (#84352)

With side effects that may go on top, it may be block morph's
responsibility to set this flag.

Also set the type of the reused GT_COMMA nodes; haven't actually seen
any issues here, but seems prudent to do this.

Fixes some stress issues seen over in #83771.

19 months agoFix eventpipe/enabledisable.cs test on Android (#84409)
Alexander Köplinger [Thu, 6 Apr 2023 21:51:02 +0000 (23:51 +0200)]
Fix eventpipe/enabledisable.cs test on Android (#84409)

It needs the same customization that we have in IpcTraceTest.cs

19 months agoCorrectly display the GCSettings specified in the runtimeconfig json via the GC Confi...
Mukund Raghav Sharma (Moko) [Thu, 6 Apr 2023 21:47:56 +0000 (14:47 -0700)]
Correctly display the GCSettings specified in the runtimeconfig json via the GC Configuration API Call  (#84201)

Fixes #84198 by honoring the user specified GC Configuration by appropriately setting the Configuration obtained from both the Environment Variables and the JSON Configuration.

19 months agoadded explanation to more GC data structures (#84162)
Maoni Stephens [Thu, 6 Apr 2023 21:19:36 +0000 (14:19 -0700)]
added explanation to more GC data structures (#84162)

+ added explanation to generation, dynamic_data and heap_segment, especially to mention which fields will need to be taken care of if we change the heap count
+ removed the unused pinned_allocated field from generation

19 months agoUnit tests should re-enable BinaryFormatter for compat testing (#84437)
Levi Broderick [Thu, 6 Apr 2023 21:09:21 +0000 (14:09 -0700)]
Unit tests should re-enable BinaryFormatter for compat testing (#84437)

19 months ago[mono][jit] Revert parts of '[mono] Remove the support for non r4fp, its not used...
Zoltan Varga [Thu, 6 Apr 2023 21:03:51 +0000 (17:03 -0400)]
[mono][jit] Revert parts of '[mono] Remove the support for non r4fp, its not used by any supported platforms. (#82005)' (#84418)

Some platforms don't support r4fp, so put back the general JIT support code.
Force r4fp on platforms that support it.

Fixes https://github.com/dotnet/runtime/issues/84401.

19 months ago[RISC-V] Port Mono for RISC-V 64 Arch (3/3) IL Lowering & Outputting (#83716)
VincentWu [Thu, 6 Apr 2023 21:02:41 +0000 (05:02 +0800)]
[RISC-V] Port Mono for RISC-V 64 Arch (3/3) IL Lowering & Outputting (#83716)

* IL lowering & output

* add blank line at end of file

* format

19 months agoReserving two diagnostic codes for serialization work (#84439)
Levi Broderick [Thu, 6 Apr 2023 21:01:00 +0000 (14:01 -0700)]
Reserving two diagnostic codes for serialization work (#84439)

19 months agoEnable building preview workload components (#84365)
Jacques Eloff [Thu, 6 Apr 2023 20:59:52 +0000 (13:59 -0700)]
Enable building preview workload components (#84365)

To support insertions of multiple SDKs into Visual Studio, the components associated with workloads need to have unique IDs. Currently there is a 1:1 mapping between VS components and .NET workloads. Inserting multiple SDKs into VS creates a conflict. The Aracde tasks used to create workloads were updated to produce two sets of components with the second set containing an additional .pre suffix.

The build would produce one additional artifact for VS

19 months agoFixes for BuildAsStandalone in tests (#84374)
Mark Plesko [Thu, 6 Apr 2023 20:39:50 +0000 (13:39 -0700)]
Fixes for BuildAsStandalone in tests (#84374)

This should fix test builds with `set BuildAsStandalone=true`.

- [Remove](https://github.com/dotnet/runtime/commit/5f14f058f4ed2f70633abea1bb59f34203e1718d) unconditional `<BuildAsStandalone>false</BuildAsStandalone>` from various HardwareIntrinsics tests. This is already the default via Directory.Build.props but interferes with `set BuildAsStandalone=true`.  (nit - also remove an empty `PropertyGroup` from GitHub_43569.csproj)
- [Remove `Main` methods](https://github.com/dotnet/runtime/commit/0a886f8ee12eff9abb6d52391a1c324da6add1e6). We might be able to pursue a strategy where the test author provides a `Main(args)` method for local custom execution. The test would either need a separate parameterless [Fact] method or a [Theory] plus data for `Main` for merged group to execute it. However, a RequiresProcessIsolation/BuildAsStandalone build would ignore that metadata, so I'd like to avoid that complexity. The Main methods here set a bool or parse an int, which can be added locally to any test as needed.
- [Add comment](https://github.com/dotnet/runtime/commit/e79a10c9e397caf90c8342dfea5707b8a35f3b3d) to Directory.Merged.props (addressing feedback on #83462)
- [Add the Methodical test back into the superpmi test](https://github.com/dotnet/runtime/commit/7c61de8574b0995fbd7779987a8eb6a35c059117) using RequiresProcessIsolation

Fixes #76421
Fixes #81984

19 months agoRemoving test case that is not working on chrome anymore (#84440)
Thays Grazia [Thu, 6 Apr 2023 19:14:22 +0000 (16:14 -0300)]
Removing test case that is not working on chrome anymore (#84440)

19 months agoDisable StackallocBlkTests test on Mono (#84408)
Egor Bogatov [Thu, 6 Apr 2023 18:57:59 +0000 (20:57 +0200)]
Disable StackallocBlkTests test on Mono (#84408)

* Disable StackallocBlkTests test on Mono

* trigger CI

19 months agoMicrosoft.NETCore.Platforms: support adding rids with '-' in the base part. (#84413)
Tom Deseyn [Thu, 6 Apr 2023 18:50:50 +0000 (20:50 +0200)]
Microsoft.NETCore.Platforms: support adding rids with '-' in the base part. (#84413)

* Microsoft.NETCore.Platforms: support adding rids with '-' in the base part.

Currently when trying to add a rid like 'linux-musl-x64'
the rid is not understood to be base = 'linux-musl', arch = 'x64'.

Instead the parser considers a potential optional qualifier.
This causes the rid to be parsed as base = 'linux', arch = 'musl',
and qualifier = 'x64'.

We know the rids being added won't have a qualifier. If we take
this into account while parsing, we can parse the rid correctly.

* Update src/libraries/Microsoft.NETCore.Platforms/src/RuntimeGroupCollection.cs

Co-authored-by: Eric StJohn <ericstj@microsoft.com>
---------

Co-authored-by: Eric StJohn <ericstj@microsoft.com>
19 months agoMove over all interop generator unit tests to use raw string literals (#84391)
Jeremy Koritzinsky [Thu, 6 Apr 2023 18:00:25 +0000 (11:00 -0700)]
Move over all interop generator unit tests to use raw string literals (#84391)

19 months agoAlways create loop pre headers (#83956)
Bruce Forstall [Thu, 6 Apr 2023 15:49:07 +0000 (08:49 -0700)]
Always create loop pre headers (#83956)

* Always create loop pre-header

As part of finding natural loops and creating the loop
table, create a loop pre-header for every loop. This
simplifies a lot of downstream phases, as the loop
pre-header will be guaranteed to exist, and will already
exist in the dominator tree.

Introduce code to preserve an empty pre-header block through
the optimization phases.

Remove now unnecessary code in hoisting and elsewhere.

Fixes #77033, #62665

* Fix loop unrolling to work with loop pre-headers

* Add `optLoopsRequirePreHeaders` variable

* Prevent removing pre-header blocks

* Allow removing unreachable pre-headers

Disallow creating pre-header after SSA is built

* Make optLoopCloningEnabled() static

* Teach loop cloning to expect and respect loop pre-headers

* Remove special case pre-header handling in hoisting

* Remove unused SSA update code in fgCreateLoopPreHeader

* Remove unneeded pre-header code from fgDominate

* Remove workaround to avoid extraneous LSRA diffs due to bbNum ordering

* Update comments

* Improve loop table rebuilding with pre-headers

When the loop table is built, it looks around for various loop patterns,
including looking for a guaranteed-executed, pre-loop constant initializer.
This is used in loop cloning and loop unrolling. It needs to look
"a little harder" in the case we created loop pre-headers, then
rebuild the loop table (currently, only due to loop unrolling of loops that
contain nested loops). The new code only allows for empty pre-headers. This
works since in our current phase ordering, no hoisting happens by the time
the loop table is rebuilt.

(Actually, it's currently not necessary to do this at all, since the constant
initializer info is only used by cloning and loop unrolling, both of which
have finished by the time the loop table is rebuilt. However, we might someday
choose to rebuild the loop table after cloning and before unrolling, at which
point it would be necessary.)

* Update comments

19 months ago[RISC-V] Port Mono for RISC-V 64 Arch (2/3) thunk & tramponlie (#83715)
VincentWu [Thu, 6 Apr 2023 15:08:32 +0000 (23:08 +0800)]
[RISC-V] Port Mono for RISC-V 64 Arch (2/3) thunk & tramponlie (#83715)

* thunk & tramponlie for riscv64, also exception call

* format

19 months agoUse better trimming message in ValidationContext (#84326)
Eric Erhardt [Thu, 6 Apr 2023 14:31:01 +0000 (09:31 -0500)]
Use better trimming message in ValidationContext (#84326)

* Use better trimming message in ValidationContext

Add more details about why ValidationContext requires unreferenced code.

Fix #84324

* Exclude RequiresUnreferencedCodeAttribute from baseline API compat

19 months agoDon't overwrite pinned assembly versions in servicing (#84079)
Viktor Hofer [Thu, 6 Apr 2023 14:30:38 +0000 (16:30 +0200)]
Don't overwrite pinned assembly versions in servicing (#84079)

* Don't overwrite pinned assembly versions in servicing

There are eight packable projects that pin their assembly version for .NET
Framework compatibility. The incremental package servicing
infrastructure didn't check if the assembly version is pinned and always
changed it.

As an example, System.Speech pins its assembly version to 4.0.0.0 but
that version gets overwritten during servicing. I.e. for .NET 7 the
version would then change to "7.0.0.$(ServicingVersion)" which is
incorrect.

Please find the full list of impacted assemblies below:
- System.ComponentModel.Composition
- System.DirectoryServices
- System.DirectoryServices.AccountManagement
- System.DirectoryServices.Protocols
- System.Management
- System.Reflection.Context
- System.Runtime.Caching
- System.Speech

* Only pin AssemblyVersion in netstandard2.0 assemblies

These assemblies pin their AssemblyVersion to be compatible with
.NETFramework where the same assembly is inbox.

The only TargetFramework we build that is compatible with .NETFramework
is netstandard2.0, so only pin the assembly on that framework.

* Override AssemblyVersion in Directory.Build.targets

Previously assemblies would set AssemblyVersion in Directory.Build.props
which was too early, because later packaging.targets could not distinguish
between a value that was explicitly set and the default value of the repo.

Instead override the value after the Servicing value is set, in
Directory.Build.targets

* Update comments

* Remove ValidateAssemblyVersionsInRefPack target

The only thing this target did was a redundant check that AssemblyVersion was
set for projects in the Targeting Pack.  That check was failing for
the NETStandard build of System.DirectoryServices.

This target was providing no value, instead we need to fix https://github.com/dotnet/runtime/issues/42961
which will be a proper check of our servicing version rules.

* Address feedback

---------

Co-authored-by: Eric StJohn <ericstj@microsoft.com>
19 months agoFix BeginReceiveMessageFromV4BoundToSpecificV6_NotReceived (#83463)
Anton Firszov [Thu, 6 Apr 2023 13:55:21 +0000 (15:55 +0200)]
Fix BeginReceiveMessageFromV4BoundToSpecificV6_NotReceived (#83463)

19 months ago[mono][interp] Remove MINT_LEAVE opcode (#84410)
Vlad Brezae [Thu, 6 Apr 2023 13:43:42 +0000 (16:43 +0300)]
[mono][interp] Remove MINT_LEAVE opcode (#84410)

It is identical to MINT_BR

19 months ago[mono][tests] Properly triage known GC failure (#84403)
Vlad Brezae [Thu, 6 Apr 2023 13:29:35 +0000 (16:29 +0300)]
[mono][tests] Properly triage known GC failure (#84403)

19 months ago[wasm] Implement LEAVE_CHECK in the jiterpreter (as a bailout) (#84387)
Katelyn Gadd [Thu, 6 Apr 2023 12:08:58 +0000 (05:08 -0700)]
[wasm] Implement LEAVE_CHECK in the jiterpreter (as a bailout) (#84387)

LEAVE_CHECK is a variant of LEAVE that only appears inside catch clauses, and catch clauses will not be running during normal optimized execution. So it's reasonable for the jiterpreter to compile them into bailouts, which will allow trace compilation to continue past the catch clause.

19 months agoAdd Utf8.TryWrite (#83852)
Stephen Toub [Thu, 6 Apr 2023 11:12:46 +0000 (07:12 -0400)]
Add Utf8.TryWrite (#83852)

* Add Utf8.TryWrite

Initial implementation of Utf8.TryWriteUtf8. The performance of this won't be great at present, but will improve as our cores types add implementation of IUtf8SpanFormattable. For tests, I copy/pasted the tests we had for MemoryExtensions.TryWrite and searched/replaced to make them work for Utf8.TryWrite.

* Address PR feedback

19 months agoFix Roslyn dependency version in source-build (#84366)
Jeremy Koritzinsky [Thu, 6 Apr 2023 06:23:49 +0000 (23:23 -0700)]
Fix Roslyn dependency version in source-build (#84366)

19 months agoDisable nullability checks in file shared between the managed type system and ILVerif...
Jeremy Koritzinsky [Thu, 6 Apr 2023 05:23:20 +0000 (22:23 -0700)]
Disable nullability checks in file shared between the managed type system and ILVerificationTests (#84382)

This file is shared between the managed type system and the ILVerificationTests suite.
The managed type system doesn't have nullable checks turned on, but ILVerificationTests does. This was causing build failures in PRs that build the ILVerificationTests.

We should enable nullable checking in the future in the managed type system as a whole at some point, but we aren't there yet.

19 months ago[mono][aot] Fix an assert. (#84385)
Zoltan Varga [Thu, 6 Apr 2023 05:20:31 +0000 (01:20 -0400)]
[mono][aot] Fix an assert. (#84385)

This is hit when AOTing GitHub_27678.dll.

19 months agoFix ThunkGenerator (#84390)
Michał Petryka [Thu, 6 Apr 2023 05:14:14 +0000 (07:14 +0200)]
Fix ThunkGenerator (#84390)

* Fix ThunkGenerator

Fixes:
```
 error CA1859: Change type of parameter 'tr' from 'System.IO.TextReader' to 'System.IO.StreamReader' for improved performance
 error CA1859: Change return type of method 'ParseInput' from 'System.Collections.Generic.IEnumerable<Thunkerator.FunctionDecl>' to 'System.Collections.ObjectModel.ReadOnlyCollection<Thunkerator.FunctionDecl>' for improved performance
```

* Fix typo

19 months agoMake WindowsServiceLifetime gracefully stop (#83892)
Eric StJohn [Thu, 6 Apr 2023 04:42:17 +0000 (21:42 -0700)]
Make WindowsServiceLifetime gracefully stop (#83892)

* Make WindowsServiceLifetime gracefully stop

WindowsServiceLifetime was not waiting for ServiceBase to stop the service.  As a result
we would sometimes end the process before notifying service control manager that the service
had stopped -- resulting in an error in the eventlog and sometimes a service restart.

We also were permitting multiple calls to Stop to occur - through SCM callbacks, and through
public API.  We must not call SetServiceStatus again once the service is marked as stopped.

* Alternate approach to ensuring we only ever set STATE_STOPPED once.

* Avoid calling ServiceBase.Stop on stopped service

I fixed double-calling STATE_STOPPED in ServiceBase, but this fix will
not be present on .NETFramework.  Workaround that by avoiding calling
ServiceBase.Stop when the service has already been stopped by SCM.

* Add tests for WindowsServiceLifetime

These tests leverage RemoteExecutor to avoid creating a separate service
assembly.

* Respond to feedback and add more tests.

This better integrates with the RemoteExecutor component as well,
by hooking up the service process and fetching its handle.

This gives us the correct logging and exitcode handling from
RemoteExecutor.

* Honor Cancellation in StopAsync

* Fix bindingRedirects in RemoteExecutor

* Use Async lambdas for service testing

* Fix issue on Win7 where duplicate service descriptions are disallowed

* Respond to feedback

* Fix comment and add timeout

19 months agoArm64: Optimize pairs of "str wzr" to "str xzr" (#84350)
SwapnilGaikwad [Thu, 6 Apr 2023 02:47:28 +0000 (03:47 +0100)]
Arm64: Optimize pairs of "str wzr" to "str xzr" (#84350)

Optimise following patterns

```
stp     wzr, wzr, [x2, #0x08]       =>     str     xzr, [x2, #0x08]
```

and

```
stp     wzr, wzr, [x14, #0x20]
str     xzr, [x14, #0x18]           =>     stp     xzr, xzr, [x14, #0x18]
```

19 months agoAdd ArgumentOutOfRangeException.ThrowIf{Not}Equal (#83853)
Stephen Toub [Thu, 6 Apr 2023 02:33:21 +0000 (22:33 -0400)]
Add ArgumentOutOfRangeException.ThrowIf{Not}Equal (#83853)

* Add ArgumentOutOfRangeException.ThrowIf{Not}Equal

* Address PR feedback

* Address PR feedback

19 months agoAdd back IComparable-based optimization to FrozenDictionary/Set (#84301)
Stephen Toub [Thu, 6 Apr 2023 02:32:36 +0000 (22:32 -0400)]
Add back IComparable-based optimization to FrozenDictionary/Set (#84301)

* Add back IComparable-based optimization to FrozenDictionary/Set

We previously had an optimization in FrozenDictionary/Set that special-cased a small number of value types when the default comparer is used... if that type was IComparable, we would sort the types, which would then a) enable us to immediately reject items larger than the known max, and b) enable us to stop searching once we hit an item larger than the one for which we were searching (which then implicitly also immediately rules out items smaller than the known min).

We removed that optimization in general because some prominent IComparable implementations don't always work, in particular container types like ValueTuple that implement IComparable but then it's only functional if the contained types are also comparable.  This commit puts it back for an allow-list of types.

* Address PR feedback

19 months agoSpeed up named type lookups in managed type system (#84285)
Michal Strehovský [Wed, 5 Apr 2023 23:58:06 +0000 (08:58 +0900)]
Speed up named type lookups in managed type system (#84285)

When the type system needs to resolve a named type in a module, it will do a `foreach` loop over all types in the module looking for the type. This can get mildly hot and I've seen it in CPU profiles but it never looked too important to address (despite the TODO).

But when MIBC files are passed to the compiler, this gets ridiculously hot. Compile Hello world by default: 0.98 seconds. Compile hello world with 5 MIBC files: 9.1 seconds.

This adds a hashtable to the lookup and drops the MIBC case to 1.4 seconds (we'll want to parallelize the MIBC loading on a background thread to get rid of the last mile, but first things first).

19 months ago[Android] Free up more disk space on CI builds (#84354)
Steve Pfister [Wed, 5 Apr 2023 22:32:04 +0000 (18:32 -0400)]
[Android] Free up more disk space on CI builds (#84354)

The android builds are running out of disk space when building the library test apps.  This change tries to recoup some of that space by deleting artifacts after each test was built.

19 months agoAdd missing step to native AOT dev workflow instructions (#84381)
Jan Kotas [Wed, 5 Apr 2023 21:55:43 +0000 (14:55 -0700)]
Add missing step to native AOT dev workflow instructions (#84381)

19 months agoRemoved pipeline dependencies and steps for running Maui-iOS as it has been moved...
Parker Bibus [Wed, 5 Apr 2023 20:56:55 +0000 (13:56 -0700)]
Removed pipeline dependencies and steps for running Maui-iOS as it has been moved to the performance repo. (#84363)