132323 Commits
Author SHA1 Message Date
Egor BogatovandSingleAccretion 973ceee20c JIT: Intrinsify ClearWithoutReferences and Fill (#98700)
---------

Co-authored-by: SingleAccretion <62474226+SingleAccretion@users.noreply.github.com>
2024-02-23 16:11:15 +01:00
Stephen Toub 99b76018b6 Enable Regex to use SearchValues<string> in compiled / source generator for IgnoreCase multi-strings (#98791)
* Enable Regex to use SearchValues<string> in compiled / source generator TryFindNextStartingPosition

The analyzer determines a set of prefixes that can start any match, and then uses SearchValues with IndexOfAny to find the next one from that set. It's currently only enabled for case-insensitive; we need to do some more perf validation before enabling for case-sensitive.

* Address PR feedback

* Fix unit test
2024-02-23 06:28:30 -05:00
Milena Hristova 6f8d3e3a44 Set assets manifest metadata for assets that get shipped with .NET release (#98824)
* add metadata to manifest

* set in ItemDefinitionGroup

* remove from items

* comment
2024-02-23 11:58:36 +01:00
Kunal Pathak 3138206e74 Add missing "internal use" for register created for LoadAndInsertScalar() (#98814)
* Add internal use for LoadAndInsertScalar()

* Small cleanup

* Handle internal registers in constrained mode

* jit format
2024-02-22 23:07:09 -08:00
Andy Ayers d98af689a2 Enable RLCSE experiment in the perf lab (#98779) 2024-02-22 22:08:32 -08:00
Andy Ayers 52c14fb8d0 JIT: test the new cse policy in jit-experimental (#98777)
Add some minimal CI testing for this new CSE heuristic.

Remove testing of cross-block assertion prop, since it's now on by default.

Contributes to #92915.
2024-02-22 19:59:01 -08:00
Michal Strehovský ec7cc7bded Do not crash on a never true typeof(T) == typeof(Gen<>) (#98836)
Fixes #98821.
2024-02-22 17:48:36 -08:00
Noah Falk 34ecd6f5c5 Update DiagnosticSourceUsersGuide.md (#98801)
Fix doc issues raised in https://github.com/dotnet/runtime/issues/98499

DiagnosticListener can send events that don't satisfy the filter. This is non-obvious behavior so the docs should call it out.

There was some funky guidance about naming of payload types that conflicts with our standard namespace naming guidelines so I removed it.
2024-02-22 17:18:52 -08:00
Jackson Schuster d676724047 Cache the InterfaceImplementation for the concrete type that requires the DIM to be kept in DefaultInterfaceImplementations cache (#98782)
Previously, we would cache the InterfaceImpl that pointed to the interface that provided the DIM. It should be the original type that created the need for the DIM.
2024-02-22 17:12:09 -08:00
Aman Khalid 9512aabfa4 JIT ARM64-SVE: Add encodings FL_3A to FX_3A (#98832)
Part of #94549. Implements the following encodings:

IF_SVE_FL_3A
IF_SVE_FM_3A
IF_SVE_FN_3A
IF_SVE_FN_3B
IF_SVE_FO_3A
IF_SVE_FP_3A
IF_SVE_FQ_3A
IF_SVE_FS_3A
IF_SVE_FW_3A
IF_SVE_FX_3A
2024-02-22 20:05:41 -05:00
Michal Strehovský a98016be50 Add some linux-arm test coverage (#98022) 2024-02-23 00:53:05 +01:00
Michal Strehovský 1bd0b5be89 Detect CPUs with throttled 512-bit width instructions (#98806)
When compiling with `--instruction-set:native` detect the CPUs that implemented AVX-512 in a way where it's better not to use it much.

This replicates the check in codeman.cpp and passes the same flag to JIT that the VM would pass.

I noticed this because passing `--instruction-set:native` to our ASP.NET benchmark machines murders the performance (minus 10+% in RPS) instead of helping it in any way. Passing `--application.environmentVariables DOTNET_PreferredVectorBitWidth=512` kills it in similar way with CoreCLR-JIT, so this detection will likely fix it.
2024-02-23 00:52:24 +01:00
Will Smith 5ce2674664 JIT: ARM64 SVE format encodings, SVE_BI_2A to SVE_HF_2A (#98784) 2024-02-22 14:56:31 -08:00
SteveandJan Kotas 15ff723dfe Support generic arguments for calli in CoreCLR (#97079)
* Add generic support for calli

* Consider classInst as well

* Block runtime marshaling for calli

* Fix the error mode

* Adding tests

* Compare instantiations as well when lookup

* Adding more test cases

* Avoid getting export multiple times

* Improve tests

* Use standard boolean

* Handle collectible assemblies

* Handle inlined P/Invoke transitions

* Reimplement unloadability handling

* Fix native library resolving in tests

* Use AllocMemTracker properly

* Skip tests on windows x86

* Skip negative tests on Windows x86 and NativeAOT

* Use better exception message

* Exclude tests for mono

* Use correct loader elsewhere

* Put VASigCookieBlock on loader module

* Move VASigCookie creation to a new method

* Update issues.targets

* Allocate StubMD on loader module

* Add an error mode for generic varargs

* Apply suggestions from code review

Co-authored-by: Jan Kotas <jkotas@microsoft.com>

* Tweak the tests

* Add link to an GH issue

---------

Co-authored-by: Jan Kotas <jkotas@microsoft.com>
2024-02-22 11:47:17 -08:00
Aman Khalid c86ab13ebc JIT: Invalidate m_switchDescMap instead of updating it (#98789)
Fixes #98772. Recently, we started checking successor edge likelihoods in Compiler::fgDebugCheckProfileWeights by default; this means we call Compiler::fgDebugCheckOutgoingProfileData in Debug/Checked builds to verify successor edges' likelihoods, and thus call BasicBlock::GetSucc(unsigned, Compiler*) to iterate the successor edges. For switch blocks, GetSucc(unsigned, Compiler*) calls GetSwitchDescMap, and builds m_switchDescMap if it doesn't exist yet. Upon finishing edge likelihood verification, we don't reset m_switchDescMap, so it is possible for this map to be created earlier in Debug/Checked builds versus Release builds.

This doesn't result in behavioral diffs if the map contains the same state between Debug/Release builds by the time it is read. However, if the map is null by the time it is needed, it is created on-demand, ensuring it is completely up-to-date. If the map is not null, the correctness of its current state depends on how judiciously it was maintained with UpdateSwitchTableTarget, creating potential for diffs in the map's state. By invalidating the map instead of updating it as state changes, we can force it to be rebuilt with the latest state when it's needed.
2024-02-22 14:09:36 -05:00
Kunal Pathak b5038db325 Add back optimization of Encode using arm64 load/store/vectortablelookup (#98719) 2024-02-22 10:29:15 -08:00
Katelyn Gadd 2106224d35 Restore erroneously removed encoding of the argument count in a generic method instantiation (#98731) 2024-02-22 09:09:50 -08:00
dotnet-maestro[bot]anddotnet-maestro[bot] ec3499a497 Update dependencies from https://github.com/dotnet/roslyn-analyzers build 20240221.1 (#98809)
Microsoft.CodeAnalysis.Analyzers , Microsoft.CodeAnalysis.NetAnalyzers
 From Version 3.11.0-beta1.24117.1 -> To Version 3.11.0-beta1.24121.1

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
2024-02-22 10:28:31 -06:00
dotnet-maestro[bot]anddotnet-maestro[bot] 5562eecc5f Update dependencies from https://github.com/dotnet/emsdk build 20240221.1 (#98808)
Microsoft.SourceBuild.Intermediate.emsdk , Microsoft.NET.Runtime.Emscripten.3.1.34.Python.win-x64 , Microsoft.NET.Workload.Emscripten.Current.Manifest-9.0.100.Transport
 From Version 9.0.0-preview.2.24120.1 -> To Version 9.0.0-preview.2.24121.1

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
2024-02-22 10:27:32 -06:00
Andy Ayers e86f8d00c6 JIT: fix issue runing RLCSE in release (#98785)
A bit of necessary code was under #ifdef DEBUG.
2024-02-22 07:27:25 -08:00
Milena HristovaandViktor Hofer a35e4778d0 Add ProducesNetCoreAssets property to Publishing.props (#98665)
* add property to publishing.props

* rename to ProducesDotNetReleaseShippingAssets

* Update Publishing.props

---------

Co-authored-by: Viktor Hofer <viktor.hofer@microsoft.com>
2024-02-22 16:19:00 +01:00
Jan Vorlicek 6b26684883 Fix VS debugger tests issues (#98783)
* Fix VS debugger tests issues

This change fixes three issues I have found in the debugger related code
after I was finally able to run the VS debugger tests with .NET 9.
These are the fixed issues:
* The old EH for hardware exceptions puts incorrectly the exception
  location adjusted by -1 to the exception stack trace. The new EH
  didn't have this problem, but VS expects that to be the case, so I
  have added a compensation for it until the old EH is gone or until VS
  can be changed to support both cases.
* Exception interception was not working correctly for cases when the
  exception needed to be propagated over native runtime frames. After
  catching the rethrown SEH / PAL_SEHException and also in
  ProcessCLRException for Windows, the interception needs to be detected
  and instead of calling the DispatchManagedException, we need to
  call the Ex.RhUnwindAndIntercept again.
* The first chance exception debugger notification was sometimes sent
  before even the first stack frame was added to the exception stack
  trace. That has broken quite a number of VS tests.

* Fix missing ifdef to fix x86 build

* Fix crossdac build
2024-02-22 14:06:49 +01:00
Radek Zikmund dcc66a7ca2 Privately expose MsQuic performance counters (#98422)
* Dump select counters after running functional tests.

* V1 of counter implementation

* Fix compilation

* Switch to Metrics API

* Code review feedback

* Rename to QuicTestCollection

* Move to instrument per metric

* Remove unwanted code

* Rename file

* Redisable paralellization
2024-02-22 13:34:05 +01:00
Tomasz Sowiński 24a906938f [RISC-V] Check DivideByZeroException before generating check for unsigned div/mod (#98648)
* Generate check for unsigned divide by zero only when ExceptionSetFlags::DivideByZeroException is present

Not doing so caused JITting on FullOpts fail on assert(add->acdUsed) in genJumpToThrowHlpBlk_la when the DivByZero check was optimized out as a result of #98113

* Change check for GT_DIV or GT_MOD in LSRA to look the same as CodeGen::genCodeForDivMod
2024-02-22 12:21:12 +01:00
Meri Khamoyan 8dcb639fac [browser][MT] Log ManagedThreadId and NativeThreadId for known test failures (#98291)
Log ManagedThreadId and NativeThreadId for known test failures
2024-02-22 11:57:45 +01:00