platform/upstream/dotnet/runtime.git
18 months ago[RISC-V][JIT] Fix assert on passing double in struct (#84584)
t-mustafin [Wed, 12 Apr 2023 12:54:13 +0000 (15:54 +0300)]
[RISC-V][JIT] Fix assert on passing double in struct (#84584)

18 months ago[Mono] Enable the supported V128 SIMD intrinsics on Arm64 across all codegen engines...
Fan Yang [Wed, 12 Apr 2023 12:50:49 +0000 (08:50 -0400)]
[Mono] Enable the supported V128 SIMD intrinsics on Arm64 across all codegen engines (#84289)

* Enable the supported ones

* Add supporte for Create* and fix a bug

* Fix CreateScalar for floating types

* Fix create*

* Address review feedback

18 months agoClear .NET Framework target while building tests with DotNetBuildFromSource. (#84682)
Tom Deseyn [Wed, 12 Apr 2023 12:37:33 +0000 (14:37 +0200)]
Clear .NET Framework target while building tests with DotNetBuildFromSource. (#84682)

* Clear .NET Framework target while building tests with DotNetBuildFromSource.

* Conditionalize on TargetFrameworkIdentifier.

18 months agoUse maxSIMDStructBytes when determining largest promotable struct size (#84623)
Tanner Gooding [Wed, 12 Apr 2023 12:31:12 +0000 (05:31 -0700)]
Use maxSIMDStructBytes when determining largest promotable struct size (#84623)

18 months agoLocalized file check-in by OneLocBuild Task: Build definition ID 679: Build ID 215635...
dotnet bot [Wed, 12 Apr 2023 11:21:11 +0000 (04:21 -0700)]
Localized file check-in by OneLocBuild Task: Build definition ID 679: Build ID 2156353 (#84669)

* Localized file check-in by OneLocBuild Task: Build definition ID 679: Build ID 2156036

* Localized file check-in by OneLocBuild Task: Build definition ID 679: Build ID 2156036

18 months agoSPMI: Add possibility to specify custom options in diffs pipeline (#84645)
Jakob Botsch Nielsen [Wed, 12 Apr 2023 11:19:06 +0000 (13:19 +0200)]
SPMI: Add possibility to specify custom options in diffs pipeline (#84645)

Allow specifying jit options on manual triggers of superpmi-diffs. I
want to use this to look at diffs with future changes in physical
promotion given that it is still disabled by default.

18 months agoBaseline failing Pri0 tests under interop/loader (#84614)
Michal Strehovský [Wed, 12 Apr 2023 09:47:42 +0000 (18:47 +0900)]
Baseline failing Pri0 tests under interop/loader (#84614)

18 months agoDelete serialization support from the managed type system (#84675)
Michal Strehovský [Wed, 12 Apr 2023 09:47:23 +0000 (18:47 +0900)]
Delete serialization support from the managed type system (#84675)

Long time ago we tried to make binary serialization sort of work with PublishAot. That code was deleted, but this was left.

18 months ago[browser][non-icu] `HybridGlobalization` not supported on WASI (#84629)
Ilona Tomkowicz [Wed, 12 Apr 2023 06:21:10 +0000 (08:21 +0200)]
[browser][non-icu] `HybridGlobalization` not supported on WASI (#84629)

* Remove WASI targets from HybridGlobalization.

* Update docs.

* Run tests only on browser.

* Do not add these files for WASI.

* Tests run only on browser.

* Missing removal.

18 months agoFix for test build break in the outerloop pipeline (#84649)
Tomáš Rylek [Wed, 12 Apr 2023 04:47:47 +0000 (06:47 +0200)]
Fix for test build break in the outerloop pipeline (#84649)

The PR

https://github.com/dotnet/runtime/pull/84383

missed one case that is now causing build errors in the Pri1 test
suite. I have attempted to fix this along the lines of the above
PR.

Thanks

Tomas

18 months agoValidate constraints on created MethodTables (#84613)
Michal Strehovský [Wed, 12 Apr 2023 03:20:59 +0000 (12:20 +0900)]
Validate constraints on created MethodTables (#84613)

We have too many IL tests in the src/tests tree that validate invalid things throw `TypeLoadException`. Things that don't meet constraints are one group of those.

18 months ago[mono][inline] Allow inlining methods containing ctor calls if they have the aggressi...
Zoltan Varga [Wed, 12 Apr 2023 03:02:11 +0000 (23:02 -0400)]
[mono][inline] Allow inlining methods containing ctor calls if they have the aggressive inlining flag. (#84660)

Re: https://github.com/dotnet/perf-autofiling-issues/issues/15660.

18 months ago[mono][jit] Intrinsify more calls to Type:op_Equality (). (#84653)
Zoltan Varga [Wed, 12 Apr 2023 02:00:32 +0000 (22:00 -0400)]
[mono][jit] Intrinsify more calls to Type:op_Equality (). (#84653)

Re: https://github.com/dotnet/perf-autofiling-issues/issues/15660.

18 months agoRevert "Mark tasks projects as non-source projects and default to Release for CI...
Larry Ewing [Wed, 12 Apr 2023 01:47:11 +0000 (20:47 -0500)]
Revert "Mark tasks projects as non-source projects and default to Release for CI/official builds(#84488)" (#84671)

This reverts commit b68f669087f546099a7b4d54bc53b7520ea24eba.

18 months agoUpdate handling of limited register during consecutive registers allocation (#84588)
Kunal Pathak [Tue, 11 Apr 2023 23:54:05 +0000 (16:54 -0700)]
Update handling of limited register during consecutive registers allocation (#84588)

* Fix issue to handle candidates that don't have assignedInterval in spillcost/prevReg

* Do not let limitRegs reduce the number of candidates

If we find out that there are no candidates free/busy for refPositions
that need consecutive registers, have at least one range of registers
in the candidates such that allocation is possible.

* getConsecutiveCandidates update if freeCandidate=RBM_NONE

Intially, we were just returning RBM_NONE if we don't find any freeCandidates,
but instead should try if we can find out if there are any busy candidates
that we should try them out.

* Relax limitStressRegs for refpositions live at consecutive register position

If consecutive registers are being allocated, other refpositions that are live
at the same location might not have enough registers left to be assigned because
all registers are busy. As such, introduce a way to track if we are assigning
at the location of consecutive registers, and if yes, do not take jitstressregs
limit into account.

* Update minRegCount for registerAssignment

For consecutive register, also include the register count needed for "minimum
register requirement" when limiting the registers.

* Remove LsraLimitFPSetForConsecutive

With other conditions in place, no need to have LsraLimitFPSetForConsecutive.

* Added an assert

* misc changes

* jit format

* Use BitOperations::BitScanForward()

* review feedback

18 months ago[NativeAOT] Fix System.Collections.Immutable.Tests (#84552)
Vladimir Sadov [Tue, 11 Apr 2023 23:47:57 +0000 (16:47 -0700)]
[NativeAOT] Fix System.Collections.Immutable.Tests (#84552)

18 months agoFix incorrect covariant returns tests (#84615)
Michal Strehovský [Tue, 11 Apr 2023 23:44:56 +0000 (08:44 +0900)]
Fix incorrect covariant returns tests (#84615)

The intention of the methods is to override a base method, but the signature is wrong so they introduce a new slot instead. The test is not testing what it wanted to tests (that the override is not reachable) because we would never call this new slot method.

`!0` and `!1` corresponds to `UNUSED1` and `UNUSED2`.

18 months ago[Area Pod: Eirik/Krzysztof/Layomi/Tarek] Exclude issues/prs for arch- and os- labels...
Jeff Handley [Tue, 11 Apr 2023 23:37:19 +0000 (16:37 -0700)]
[Area Pod: Eirik/Krzysztof/Layomi/Tarek] Exclude issues/prs for arch- and os- labels (#84654)

18 months agoFix gtSplitTree assert (#84634)
Egor Bogatov [Tue, 11 Apr 2023 23:32:36 +0000 (01:32 +0200)]
Fix gtSplitTree assert (#84634)

18 months agoAdd NuGet-Migrations workaround to runtime tests too (#84129)
Alexander Köplinger [Tue, 11 Apr 2023 22:53:42 +0000 (00:53 +0200)]
Add NuGet-Migrations workaround to runtime tests too (#84129)

See https://github.com/dotnet/runtime/issues/80619

18 months ago[JIT] Add support to inline the field access of primitive types marked with TLS ...
Kunal Pathak [Tue, 11 Apr 2023 20:53:39 +0000 (13:53 -0700)]
[JIT] Add support to inline the field access of primitive types marked with TLS (#82973)

* Add CORINFO_THREAD_LOCAL_FIELD_INFO and getThreadLocalFieldInfo()

* Implementation of getThreadLocalFieldInfo()

* Change the field types from CORINFO_CONST_LOOKUP to uint32_t

* Introduce CORINFO_FIELD_STATIC_TLS_MANAGED

* Introduce GTF_FLD_TLS_MANAGED

* Introduce eeGetThreadLocalFieldInfo()

* Fix the offsetOfThreadStaticBlocks, hardcode threadStaticBlockIndex for now

* Add impThreadLocalFieldAccess()

* Switch to GS segment register with a TODO

* Add reverse map `g_threadStaticBlockTypeIDMap` for type -> ID

* Fix GS segment register encoding

* Add comment for g_threadStaticBlockTypeIDMap

* Add extra parameter for typeIndex in JIT_GetSharedNonGCThreadStaticBase

* Update JIT_GetSharedNonGCThreadStaticBase to add logic for storing typeIndex in t_threadStaticBlocks

* Fix encoding of gs:[0x58]

* fix some bugs in importer to change size from 4 to 8

* add some printf in jithelpers

* To revert

* Update the helper to skip making re-entry for staticBlock

* Add impThreadLocalFieldWrite() for store

* Fix a issue for helper

* Use JITDUMP

* Just enable the optimization for primitive types

* Update the JITEE guid

* Fix an assert for volatile variables

* Mark helper block as cold block

* wip

* Fix the size of maxThreadStaticBlock

* fix a bug to insert the entry in cache

* Add #ifdef for HOST_WINDOWS / TARGET_WINDOWS

* Dynamic memory allocation for static block array

* Call InitTypeMap only if host == windows

* Add CORINFO_HELP_GETSHARED_NONGCTHREADSTATIC_BASE_NOCTOR_OPTIMIZED

* Expand the TLS field access in late phase

* Move rarely ran block to the end

* wip

* Fix the bug to access the value from fastPath

* Remove code from importer

* Cleanup the code

* Moved CreateBlockFromTree to fgbasic.cpp

* Move fgExpandThreadLocalAccess() to flowgraph.cpp

* Add getThreadLocalStaticBlocksInfo() method

* Consume getThreadLocalStaticBlocksInfo() method

* Updated definition of getThreadLocalFieldInfo()

* Rename CORINFO_THREAD_LOCAL_FIELD_INFO to CORINFO_THREAD_STATIC_BLOCKS_INFO

* Add TARGET_WINDOWS

* Make TARGET_WINDOWS at some definitions

* Add dummy definition for unix

* jit format

* remote unnecessary code from morph

* Fix an issue on linux, add assert for tls_index != 0

* Convert from TARGET_WINDOWS to HOST_WINDOWS

* jit format

* fix the if-check

* fix gcc build error

* Added MethodHaveTlsFieldAccess()

* Handle the case for '_tls_index == 0'

* fix a typo

* Fix windows/arm64 issue

* fix encoding of teb loading for arm64

* Fix the condition in jitinterface to select correct helper

* fix the condition for other helper too

* fix the windows/x86 case

* jit format

* Use CORINFO_CONST_LOOKUP for _tls_index

* Move typeIdMap to BaseDomain class

* Introduce useFatPointerDispatch parameter for GetTypeID()

* jit format

* Do not pass classID and moduleID to the new helper

* fix build for non-windows

* fix superpmi methods

* review feedback

* fix linux build errors

* review feedback

* fix weight inherit

* inline JIT_GetNonGCThreadStaticBase_Helper to fix the contract error

* Remove dead code from helper

* Add GTF_CALL_M_EXP_TLS_ACCESS to check if we do not revisit the already expanded call node

* address feedback

* regenerate the files

* Introduce fgExpandHelper and fgExpandHelperForBlock and reuse it for various helper expansion

* fix the typo

* update the assert for runtimelookup

* check if we should skip rarely run blocks

* review feedback

* Remove GTF_IND_INVARIANT from `typeIndex` access because it produces nullptr 1st time and valid value 2nd time onwards

18 months agoMark tasks projects as non-source projects and default to Release for CI/official...
Elinor Fung [Tue, 11 Apr 2023 20:32:51 +0000 (13:32 -0700)]
Mark tasks projects as non-source projects and default to Release for CI/official builds(#84488)

18 months ago[main] Update dependencies from dotnet/roslyn-analyzers (#84074)
dotnet-maestro[bot] [Tue, 11 Apr 2023 20:14:56 +0000 (15:14 -0500)]
[main] Update dependencies from dotnet/roslyn-analyzers (#84074)

* Update dependencies from https://github.com/dotnet/roslyn-analyzers build 20230328.1

Microsoft.CodeAnalysis.Analyzers , Microsoft.CodeAnalysis.NetAnalyzers
 From Version 3.3.5-beta1.23172.1 -> To Version 3.3.5-beta1.23178.1

* Update dependencies from https://github.com/dotnet/roslyn-analyzers build 20230405.2

Microsoft.CodeAnalysis.Analyzers , Microsoft.CodeAnalysis.NetAnalyzers
 From Version 3.3.5-beta1.23172.1 -> To Version 3.3.5-beta1.23205.2

* Update dependencies from https://github.com/dotnet/roslyn-analyzers build 20230407.2

Microsoft.CodeAnalysis.Analyzers , Microsoft.CodeAnalysis.NetAnalyzers
 From Version 3.3.5-beta1.23172.1 -> To Version 3.3.5-beta1.23207.2

---------

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
18 months agooffers to start and stop IHostedService concurrently (#84048)
Badre BSAILA [Tue, 11 Apr 2023 20:10:50 +0000 (22:10 +0200)]
offers to start and stop IHostedService concurrently (#84048)

* offers to start and stop IHostedService concurrently

18 months agoAllow removal of HWIntrinsic nodes that do not have side effects (#84110)
Tanner Gooding [Tue, 11 Apr 2023 19:39:59 +0000 (12:39 -0700)]
Allow removal of HWIntrinsic nodes that do not have side effects (#84110)

* Allow removal of HWIntrinsic nodes that do not have side effects

* Applying formatting patch

* Minimize the TP impact of the changes

* Responding to PR feedback

* Resolving minor PR feedback

* Remove the unnecessary isSimdAsHWIntrinsic parameter

18 months agoMinor fixes to write barriers (#75478)
Anton Lapounov [Tue, 11 Apr 2023 19:28:21 +0000 (12:28 -0700)]
Minor fixes to write barriers (#75478)

* Minor fixes to write barriers

* use the same predicated compare as on Unix when checking ephemeral low/high

---------

Co-authored-by: vsadov <8218165+VSadov@users.noreply.github.com>
18 months agoAvoid producing Requires* warnings when accessing constant fields (#84622)
Vitek Karas [Tue, 11 Apr 2023 18:58:40 +0000 (11:58 -0700)]
Avoid producing Requires* warnings when accessing constant fields (#84622)

Fields can only be annotated with `Requires*` attributes through their type (so RUC on type and so on). But that annotation is actually not guarding access to the field itself, but it's actually guarding access to static members, including static constructor.

Constant fields don't trigger static constructor. In fact at runtime constant fields are never accessed by code. The compiler is required to inline their values instead.

So IL based scanners will never produce the above warning, only analyzer would.

This change modifies the analyzer to stop producing warings for accessing constant fields.

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

18 months agodefine UNW_AARCH64 aliases conditionally (#84591)
Vladimir Sadov [Tue, 11 Apr 2023 18:52:49 +0000 (11:52 -0700)]
define UNW_AARCH64 aliases conditionally (#84591)

18 months agoUpdate dependencies from https://github.com/dotnet/arcade build 20230410.3 (#84633)
dotnet-maestro[bot] [Tue, 11 Apr 2023 18:51:07 +0000 (13:51 -0500)]
Update dependencies from https://github.com/dotnet/arcade build 20230410.3 (#84633)

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

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
18 months ago[android][ios] Output Exported Symbols ItemGroup in LibraryBuilder (#84581)
Steve Pfister [Tue, 11 Apr 2023 18:46:37 +0000 (14:46 -0400)]
[android][ios] Output Exported Symbols ItemGroup in LibraryBuilder (#84581)

Outputs an ItemGroup that contains the set of export symbols gathered from the AOT compiler. The intent of library mode is to create a library with only exports gathered from the AOT compiler. Since the library is static, that responsibility is pushed outward.

18 months agoFixes and tests (#84630)
Morten Larsen [Tue, 11 Apr 2023 17:53:35 +0000 (19:53 +0200)]
Fixes and tests (#84630)

18 months agoRemove unused zlib exports (#84603)
Levi Broderick [Tue, 11 Apr 2023 15:40:00 +0000 (08:40 -0700)]
Remove unused zlib exports (#84603)

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.