platform/upstream/dotnet/runtime.git
18 months ago[wasm][WBT] Fix pack pattern take two (#85391)
Pavel Savara [Wed, 26 Apr 2023 12:00:30 +0000 (14:00 +0200)]
[wasm][WBT] Fix pack pattern take two (#85391)

18 months agoImplement ICorProfilerInfo14::EnumerateNonGCObjects (#85100)
Egor Bogatov [Wed, 26 Apr 2023 11:06:05 +0000 (13:06 +0200)]
Implement ICorProfilerInfo14::EnumerateNonGCObjects (#85100)

18 months agoJIT: Introduce GT_JTEST and clean up GT_JCMP flags (#85242)
Jakob Botsch Nielsen [Wed, 26 Apr 2023 08:04:03 +0000 (10:04 +0200)]
JIT: Introduce GT_JTEST and clean up GT_JCMP flags (#85242)

* Introduce GT_JTEST to replace GTF_JCMP_TEST
* Stop encoding JCMP conditions in GenTreeFlags by switching GT_JCMP to
  a GenTreeOpCC node. This removes GTF_JCMP_EQ and the
  LoongArch64/RISC-V specific mechanism to communicate condition codes
  to the backend via gtFlags.

18 months agoFix simd12_t size (#85362)
Egor Bogatov [Wed, 26 Apr 2023 07:34:39 +0000 (09:34 +0200)]
Fix simd12_t size (#85362)

18 months agoFold IND(frozenObj, CNS) (#85127)
Egor Bogatov [Wed, 26 Apr 2023 07:21:34 +0000 (09:21 +0200)]
Fold IND(frozenObj, CNS) (#85127)

Co-authored-by: Jakob Botsch Nielsen <Jakob.botsch.nielsen@gmail.com>
18 months ago[JIT] ARM64 - Fixed regressions for `GT_NEG` containment (#85230)
Will Smith [Wed, 26 Apr 2023 07:08:06 +0000 (00:08 -0700)]
[JIT] ARM64 - Fixed regressions for `GT_NEG` containment (#85230)

* Fixed regressions for 'GT_NEG' containment on ARM64

* Containing NEG is only valid for EQ and NE.

* Update codegenarm64.cpp

* Formatting

18 months agoChange `callvirt` into `calli` for virtual delegates (#83461)
Vlad-Alexandru Ionescu [Wed, 26 Apr 2023 06:27:29 +0000 (08:27 +0200)]
Change `callvirt` into `calli` for virtual delegates (#83461)

JIT delegates do not depend on the target method and an call is used

---------

Signed-off-by: Vlad - Alexandru Ionescu <vlad-alexandruionescu@Vlads-MacBook-Pro-2.local>
Co-authored-by: Vlad - Alexandru Ionescu <vlad-alexandruionescu@Vlads-MacBook-Pro-5.local>
18 months agoDon't re-scan previously visited blocks in helperexpansion.cpp (#85201)
Egor Bogatov [Wed, 26 Apr 2023 05:34:01 +0000 (07:34 +0200)]
Don't re-scan previously visited blocks in helperexpansion.cpp (#85201)

18 months ago[Wasm.Build.Tests] Fixup wildcard matching for runtime packs (#85286)
Aleksey Kliger (λgeek) [Wed, 26 Apr 2023 01:55:38 +0000 (21:55 -0400)]
[Wasm.Build.Tests] Fixup wildcard matching for runtime packs (#85286)

The naming is
`Microsoft.NETCore.App.Runtime.Mono.{variant}.{rid}.{version}.nupkg`

Fixes local WBT builds for non-default runtime variants (eg: build
with `/p:MonoWasmBuildVariant=multithread` then run WBT)

18 months agoGuard DynamicDependency processing against `TypeSystemException`s (#85285)
Michal Strehovský [Wed, 26 Apr 2023 01:09:13 +0000 (10:09 +0900)]
Guard DynamicDependency processing against `TypeSystemException`s (#85285)

Works around https://github.com/dotnet/fsharp/issues/15140 and it's also just good hygiene.

18 months agoRe-enable PGO for linux (#85355)
Sven Boemer [Wed, 26 Apr 2023 00:55:36 +0000 (17:55 -0700)]
Re-enable PGO for linux (#85355)

18 months ago[hot_reload] assorted hot reload fixes for cumulative property updates (#85351)
Aleksey Kliger (λgeek) [Tue, 25 Apr 2023 23:58:51 +0000 (19:58 -0400)]
[hot_reload] assorted hot reload fixes for cumulative property updates (#85351)

* [hot_reload] remove unneeded assertion

`is_addition` is already defined as `token_index-1 >=
delta_info->count[token_table].prev_gen_rows` so:

1. the assertion as written is wrong for cumulative updates that add
new properties or events
2. the assertion would be trivially true if it was updated to use
`delta_info->count[token_table].prev_gen_rows`.

Fixes the ability to cumulatively add new properties

* Update generation on MonoClassMetadataUpdateInfo when adding members

Give recompute_ginst_update_info something to work with.

* assert that generic instances don't call hot_reload_get_property

token-based lookup should only happen for class defs or GTDs

* update regression test

18 months agoJIT: improve profile update for loop inversion (#85265)
Andy Ayers [Tue, 25 Apr 2023 23:52:56 +0000 (16:52 -0700)]
JIT: improve profile update for loop inversion (#85265)

If the loop test block has multiple predecessors we will not do proper
profile updates. This can lead to downstream problems with block layout
(say leaving a cold block in a loop).

Fix by changing how we compute the amount of profile that should remain
in the test block.

Fixes #84319.

18 months agoJIT: add ssa accounting to morph's div opts (#85332)
Andy Ayers [Tue, 25 Apr 2023 23:50:22 +0000 (16:50 -0700)]
JIT: add ssa accounting to morph's div opts (#85332)

RBO triggered a morph opt that cloned an SSA local, throwing off the SSA
accounting. Fix by invoking the accounting helper after the morph expansion.

Closes #85226.

18 months agoDirectory.Build.props: don't overwrite PackageOS from source-build. (#85350)
Tom Deseyn [Tue, 25 Apr 2023 23:44:39 +0000 (01:44 +0200)]
Directory.Build.props: don't overwrite PackageOS from source-build. (#85350)

18 months agoAdd Winforms as consultant on ComponentModel (#85363)
Eric StJohn [Tue, 25 Apr 2023 21:59:52 +0000 (14:59 -0700)]
Add Winforms as consultant on ComponentModel (#85363)

18 months agoFix a few downlevel TimeProvider issues (#85346)
Stephen Toub [Tue, 25 Apr 2023 21:59:15 +0000 (17:59 -0400)]
Fix a few downlevel TimeProvider issues (#85346)

- Consistently null check the Timer stored in the state object
- Complete the a task canceled due to the CancellationToken with the CancellationToken
- Avoid an unnecessary closure in Delay
- Make TimeProvider.System.CreateTimer use Timer's ctor that takes duration/period rather than making a separate call to Change

18 months ago[wasm] Disable `Wasm.Build.Tests.Blazor.BuildPublishTests.BugRegression_60479_WithRaz...
Marek Fišera [Tue, 25 Apr 2023 20:08:10 +0000 (22:08 +0200)]
[wasm] Disable `Wasm.Build.Tests.Blazor.BuildPublishTests.BugRegression_60479_WithRazorClassLib` (#85356)

* Add active issue on blazor lazy load test

* Add active issue on blazor lazy load test

18 months agoUse CollectionsMarshal.SetCount in LINQ to deduplicate ToArray/ToList implementations...
Stephen Toub [Tue, 25 Apr 2023 20:05:30 +0000 (16:05 -0400)]
Use CollectionsMarshal.SetCount in LINQ to deduplicate ToArray/ToList implementations (#85288)

* Use CollectionsMarshal.SetCount in LINQ to deduplicate ToArray/ToList implementations

* Fix BinaryFormatter test

The test was implemented using ToList, and `List<T>` serialization serializes out its version field.  As a result, because we're now optimizing creation and not incrementing the version as much in ToList, the blob didn't match.

18 months agoFix Avx2 helpers (#85275)
Sven Boemer [Tue, 25 Apr 2023 19:56:57 +0000 (12:56 -0700)]
Fix Avx2 helpers (#85275)

Unblocks dotnet-optimization flow and
https://github.com/dotnet/runtime/issues/84711. Includes a
dotnet-optimization update to confirm this it avoids the issue
discussed in https://github.com/dotnet/runtime/pull/84635. This
fixes that issue by preventing R2R for any Avx2 helpers which
assume they are called with Avx2 enabled.

18 months agoinit-distro-rid.sh: fix unbound error when VERSION_ID is not defined. (#85319)
Tom Deseyn [Tue, 25 Apr 2023 19:50:19 +0000 (21:50 +0200)]
init-distro-rid.sh: fix unbound error when VERSION_ID is not defined. (#85319)

18 months ago[mono][NativeAOT] System.Globalization.Native build improvements (#82393)
Filip Navara [Tue, 25 Apr 2023 18:46:56 +0000 (20:46 +0200)]
[mono][NativeAOT] System.Globalization.Native build improvements (#82393)

Fixes #82389

- Fixes build of System.Globalization.Native for iOS-like, browser, and wasi platforms
- Removes ICU shim from static builds of Mono runtime and builds it as part of libs.native subset
- Switches browser/wasi to use the static libraries

Co-authored-by: Alexander Köplinger <alex.koeplinger@outlook.com>
18 months agoJIT: Create side effect commas as TYP_VOID in block morph (#85320)
Jakob Botsch Nielsen [Tue, 25 Apr 2023 18:13:58 +0000 (20:13 +0200)]
JIT: Create side effect commas as TYP_VOID in block morph (#85320)

This code could create IR shapes like

COMMA struct
  ...
  ASG struct
    dst
    src

After liveness that would sometimes result in

COMMA struct
  ...
  NOP void

which could confuse optimization phases when JitOptRepeat was enabled.

The more canonical shape for these side-effecting GT_COMMA nodes has
them TYP_VOID typed as shown by gtExtractSideEffList, so do the same in
block morph.

Fix #85037

18 months agoExpose various Convert intrinsics for Avx512F, Avx512BW, and Avx512DQ (#85281)
Tanner Gooding [Tue, 25 Apr 2023 18:11:09 +0000 (11:11 -0700)]
Expose various Convert intrinsics for Avx512F, Avx512BW, and Avx512DQ (#85281)

* Expose various Convert intrinsics for Avx512F and Avx512DQ

* Expose various integer conversion APIs for Avx512F and Avx512BW

* Ensure special instructions are handled in codegen

* Apply formatting patch

* Ensure the AVX512F_VL variant is picked for simdSize=16/32

* Ensure conversion instructions are handled in PERFSCORE

* Ensure instructions use the right tuple type

* Removing an invalid API and fix more PERFSCORE entries

* Resolve additional failures masked by #85056

* Ensure TieredCompilation=0 is also passing

* Apply formatting patch

* Fixing some more test edge cases

* Ensure uint64->double and uint64->Float masks the input

18 months agoSPMI: Always add authenticated pip feed for test job runs (#85327)
Jakob Botsch Nielsen [Tue, 25 Apr 2023 17:33:37 +0000 (19:33 +0200)]
SPMI: Always add authenticated pip feed for test job runs (#85327)

We always try to upload the collections for the tests, even on failures,
so we should also add the authed feed on failures.

18 months agoEnC Support for Generics (#85269)
mikelle-rogers [Tue, 25 Apr 2023 17:32:19 +0000 (10:32 -0700)]
EnC Support for Generics (#85269)

* EnC non-functional changes
- Update inappropriate naming
- Update many logging statements
- Remove unused code

* EnC support for fields on generic types

* EnC support for methods on generic types

* Fix use after free introduced in EnC breakpoint.
Fix off by one for string logging.

* update new feature capabilities, JIT GUID

* Fix non-enc build

* Fix EnCFieldIndex check

* Remove IsFdPrivate assert

---------

Co-authored-by: Aaron R Robinson <arobins@microsoft.com>
Co-authored-by: Juan Hoyos <19413848+hoyosjs@users.noreply.github.com>
Co-authored-by: Tom McDonald <tommcdon@microsoft.com>
18 months agoNativeAOT ComWrappers: fix race condition in when creating native wrapper (#85235)
Austin Wise [Tue, 25 Apr 2023 16:26:32 +0000 (09:26 -0700)]
NativeAOT ComWrappers: fix race condition in when creating native wrapper (#85235)

18 months agoPopulating JSON properties support (#83669)
Krzysztof Wicher [Tue, 25 Apr 2023 16:26:03 +0000 (18:26 +0200)]
Populating JSON properties support (#83669)

* Populating JSON properties support

* apply review feedback

* Attempt to fix build by reducing stack frame

* Fix docs

* Remove unnecessary properties from ReadStackFrame.

* Move source gen tests to the source gen test project.

* Improve test helper method name.

* Add argument validation to JsonPropertyInfo.ObjectCreationHandling & extend unit testing for the new metadata APIs.

* Add test coverage for invalid attribute annotations.

---------

Co-authored-by: Eirik Tsarpalis <eirik.tsarpalis@gmail.com>
18 months ago[NativeAOT] Do not strip exported symbols from executables on Apple platforms (#85293)
Ivan Povazan [Tue, 25 Apr 2023 16:09:40 +0000 (18:09 +0200)]
[NativeAOT] Do not strip exported symbols from executables on Apple platforms (#85293)

* Do not strip exported symbols from executables when explicitly specified

* Add '_' prefix to StripFlag internal project property

18 months agoMake Guid.HexsToChars aggressively inlined (#85322)
Stephen Toub [Tue, 25 Apr 2023 16:03:33 +0000 (12:03 -0400)]
Make Guid.HexsToChars aggressively inlined (#85322)

To help mono cope with the genericized implementation.  This method is only used when Ssse3 or AdvSimd.Arm64 are not supported, or when formatting the rarely-used "X" format, but currently mono AOT without LLVM doesn't enable those intrinsics.

18 months agoRetry compat Random.NextSingle in case rounding from double produces 1.0f (#85321)
Stephen Toub [Tue, 25 Apr 2023 16:02:20 +0000 (12:02 -0400)]
Retry compat Random.NextSingle in case rounding from double produces 1.0f (#85321)

The compat implementation behind Random just casts a double to a float to produce the result of NextSingle.  Some double values close to 1.0 might round up to 1.0f, which is out of range for NextSingle.  In that case, reject it and retry.  This approach is consistent with how fairness is handled elsewhere in the implementation, and avoids changing the sequence of values returned for a fixed seed in cases where an illegal value wasn't being returned.

18 months agoFix publishing relinked dotnet.worker.js (#85314)
Marek Fišera [Tue, 25 Apr 2023 15:56:02 +0000 (17:56 +0200)]
Fix publishing relinked dotnet.worker.js (#85314)

18 months agoAdd TargetHostName to QuicConnection (#84976)
Radek Zikmund [Tue, 25 Apr 2023 15:50:34 +0000 (17:50 +0200)]
Add TargetHostName to QuicConnection (#84976)

* Add TargetHostName to QuicConnection
Fixes #80508

* Make TargetHostName not nullable

* Fix build

* Fix build of tests

* Fix failing tests

* Code review feedback

* Use unencoded hostname in user-facing properties/params

* Fix failing tests

* Revert unwanted changes

* Add test for IDN cert validation

* Fix test again

* Fix trailing dot in hostname

18 months ago[wasm] Add more PackedSimd methods, logic ops (#85303)
Radek Doulik [Tue, 25 Apr 2023 15:33:11 +0000 (17:33 +0200)]
[wasm] Add more PackedSimd methods, logic ops (#85303)

* [wasm] Add more PackedSimd methods

* Fix doc comments

18 months agoFix the TimeProvider test (#85268)
Tarek Mahmoud Sayed [Tue, 25 Apr 2023 14:32:51 +0000 (07:32 -0700)]
Fix the TimeProvider test (#85268)

* Fix the TimeProvider test

* remove the assert

18 months agoFix coreclr-release-outerloop-nightly pipeline (#85278)
Tomáš Rylek [Tue, 25 Apr 2023 14:30:53 +0000 (16:30 +0200)]
Fix coreclr-release-outerloop-nightly pipeline (#85278)

18 months ago[RISC-V] Add RISC-V CI (#85289)
Dong-Heon Jung [Tue, 25 Apr 2023 14:28:27 +0000 (23:28 +0900)]
[RISC-V] Add RISC-V CI (#85289)

- Add RISC-V Checked Build CI
- https://github.com/dotnet/runtime/issues/84834

18 months agoJIT: Support some assignment decomposition in physical promotion (#85105)
Jakob Botsch Nielsen [Tue, 25 Apr 2023 13:57:48 +0000 (15:57 +0200)]
JIT: Support some assignment decomposition in physical promotion (#85105)

Add support for directly initializing and copying into replacements
instead of doing a struct local and read back. Physically promoted
struct locals used as sources are still handled conservatively (by first
writing them back to stack, then doing the copy).

For example, for a case like

```
void Foo()
{
    S s = _field;
    s.A = s.B + 3;
    Consume(s);
}

struct S
{
    public int A, B;
}
```

We see the following:

```
STMT00000 ( 0x000[E-] ... 0x006 )
               [000003] -A-XG------                         ▌  ASG       struct (copy)
               [000002] D------N---                         ├──▌  LCL_VAR   struct<Program+S, 8> V01 loc0
               [000001] ---XG------                         └──▌  FIELD     struct Program:_field
               [000000] -----------                            └──▌  LCL_VAR   ref    V00 this          (last use)
Processing block operation [000003] that involves replacements
New statement:
STMT00000 ( 0x000[E-] ... 0x006 )
               [000029] -A-XG------                         ▌  COMMA     int
               [000021] -A-XG------                         ├──▌  ASG       int
               [000015] D------N---                         │  ├──▌  LCL_VAR   int    V03 tmp1
               [000020] ---XG------                         │  └──▌  IND       int
               [000018] -----------                         │     └──▌  ADD       ref
               [000016] -----------                         │        ├──▌  LCL_VAR   ref    V00 this
               [000017] -----------                         │        └──▌  CNS_INT   long   8
               [000028] -A-XG------                         └──▌  ASG       int
               [000022] D------N---                            ├──▌  LCL_VAR   int    V04 tmp2
               [000027] ---XG------                            └──▌  IND       int
               [000025] -----------                               └──▌  ADD       ref
               [000023] -----------                                  ├──▌  LCL_VAR   ref    V00 this
               [000024] -----------                                  └──▌  CNS_INT   long   12
```

The logic is currently quite rudimentary when it comes to
holes/uncovered parts of the struct. For example, in the above case if
we add another unused field at the end of S then the result is:

```
STMT00000 ( 0x000[E-] ... 0x006 )
               [000003] -A-XG------                         ▌  ASG       struct (copy)
               [000002] D------N---                         ├──▌  LCL_VAR   struct<Program+S, 12> V01 loc0
               [000001] ---XG------                         └──▌  FIELD     struct Program:_field
               [000000] -----------                            └──▌  LCL_VAR   ref    V00 this          (last use)
Processing block operation [000003] that involves replacements
Struct operation is not fully covered by replaced fields. Keeping struct operation.
New statement:
STMT00000 ( 0x000[E-] ... 0x006 )
               [000030] -A-XG------                         ▌  COMMA     struct
               [000021] -A-XG------                         ├──▌  ASG       int
               [000015] D------N---                         │  ├──▌  LCL_VAR   int    V03 tmp1
               [000020] ---XG------                         │  └──▌  IND       int
               [000018] -----------                         │     └──▌  ADD       ref
               [000016] -----------                         │        ├──▌  LCL_VAR   ref    V00 this
               [000017] -----------                         │        └──▌  CNS_INT   long   8
               [000029] -A-XG------                         └──▌  COMMA     struct
               [000028] -A-XG------                            ├──▌  ASG       int
               [000022] D------N---                            │  ├──▌  LCL_VAR   int    V04 tmp2
               [000027] ---XG------                            │  └──▌  IND       int
               [000025] -----------                            │     └──▌  ADD       ref
               [000023] -----------                            │        ├──▌  LCL_VAR   ref    V00 this
               [000024] -----------                            │        └──▌  CNS_INT   long   12
               [000003] -A-XG------                            └──▌  ASG       struct (copy)
               [000002] D------N---                               ├──▌  LCL_VAR   struct<Program+S, 12> V01 loc0
               [000001] ---XG------                               └──▌  FIELD     struct Program:_field
               [000000] -----------                                  └──▌  LCL_VAR   ref    V00 this
```

In this case it would be significantly more efficient to copy only the
remainder, which is just a small part of the struct. However, in the
general case it is not easy to predict the most efficient way to do
this, and in some cases we cannot even represent the hole in JIT IR (if
it involves GC pointers), so I have left this for a future change for
now. Liveness should also be beneficial for that as there are many cases
where we would expect the remainder to be dead.

18 months agoRemove useless serializability checks (#80957)
madelson [Tue, 25 Apr 2023 13:47:38 +0000 (09:47 -0400)]
Remove useless serializability checks (#80957)

18 months ago[mono] Remove mono_dl_open_runtime_lib() (#85253)
Alexander Köplinger [Tue, 25 Apr 2023 13:45:51 +0000 (15:45 +0200)]
[mono] Remove mono_dl_open_runtime_lib() (#85253)

It was only used to load the profiler from an "installed" path, but that is no longer a thing in modern .NET

18 months ago[mono][interp] Fix il_offset of inserted instructions (#85305)
Vlad Brezae [Tue, 25 Apr 2023 13:02:54 +0000 (16:02 +0300)]
[mono][interp] Fix il_offset of inserted instructions (#85305)

After the original codegen happens, where instructions have the associated il_offset set, we might still generate new instruction as part of various optimizations. They would have the associated il_offset of the end of the method which is incorrect and was screwing up mapping from native_offset to il_offset.

18 months agoAdd function pointer type support to type loader (#85287)
Michal Strehovský [Tue, 25 Apr 2023 08:51:41 +0000 (17:51 +0900)]
Add function pointer type support to type loader (#85287)

So that we can create new function pointer types at runtime within the context of `MakeGenericXXX`.

18 months agoJIT: Allow spill-at-single-def for pure defs (#85251)
Jakob Botsch Nielsen [Tue, 25 Apr 2023 08:47:09 +0000 (10:47 +0200)]
JIT: Allow spill-at-single-def for pure defs (#85251)

Allow the spill-at-single-def logic to kick in for defs without subsequent uses before the spill.

18 months agoAdd authenticated PIP feed before its use in internal JIT pipelines (#85292)
Jakob Botsch Nielsen [Tue, 25 Apr 2023 08:45:57 +0000 (10:45 +0200)]
Add authenticated PIP feed before its use in internal JIT pipelines (#85292)

This unblocks internal JIT pipelines.

18 months agoFix edge case in stack overflow handling (#85272)
Jan Vorlicek [Tue, 25 Apr 2023 08:16:02 +0000 (10:16 +0200)]
Fix edge case in stack overflow handling (#85272)

There is a problematic case when the stack overflow happens in native code
and there is an explicit frame between the managed and native code. Some
time ago, I have added a fix for a problem when the stack overflow
happened in native code, but I haven't found that it actually works only
in case there is no explicit frame between the managed code and the
failing native code frame. That fix makes the `FaultingExceptionFrame`
that is created for the stack overflow to contain context of the managed
code frame, so the stack walker uses that to move to the next frame. But
while doing so, it hits the other explicit frame that it doesn't expect
there and fires an assert.

This fix handles the problematic case correctly.

18 months ago[main] Update dependencies from dotnet/runtime (#85249)
dotnet-maestro[bot] [Tue, 25 Apr 2023 07:51:48 +0000 (09:51 +0200)]
[main] Update dependencies from dotnet/runtime (#85249)

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
18 months agoDisable gcstress and jitstress for tracing tests (#85186)
David Mason [Tue, 25 Apr 2023 06:51:20 +0000 (23:51 -0700)]
Disable gcstress and jitstress for tracing tests (#85186)

* Disable gcstress and jitstress

* Fix EventListenerThreadPool proj

---------

Co-authored-by: Juan Hoyos <19413848+hoyosjs@users.noreply.github.com>
18 months agoEmit GC info into a COMDAT section (#83371)
Michal Strehovský [Tue, 25 Apr 2023 06:24:05 +0000 (15:24 +0900)]
Emit GC info into a COMDAT section (#83371)

Saves 3.14% on BasicWebApi. 🤯

We run linker with COMDAT folding enabled. Generating this data into COMDAT foldable section allows linker to deduplicate these.

18 months agoSpecify -z notext on linux-musl-x86 and riscv64 (#83682)
Adeel Mujahid [Tue, 25 Apr 2023 05:46:16 +0000 (08:46 +0300)]
Specify -z notext on linux-musl-x86 and riscv64 (#83682)

* Specify -z notext on linux-musl-x86

* Fix riscv64 build with clang/lld v15+

* Inline visibility attribute

* Fix gcc build

18 months agorefactor the g_SyncBlockCacheInstance for aligned (#85241)
Qiao Pengcheng [Tue, 25 Apr 2023 05:45:43 +0000 (13:45 +0800)]
refactor the g_SyncBlockCacheInstance for aligned (#85241)

18 months agoEnable ComWrappers for NativeAOT on non-Windows (#85000)
Jeremy Koritzinsky [Tue, 25 Apr 2023 03:46:39 +0000 (20:46 -0700)]
Enable ComWrappers for NativeAOT on non-Windows (#85000)

18 months agoBuild Mono LLVM legs on the CBL-Mariner images, but run the AOTing steps on CentOS...
Jeremy Koritzinsky [Tue, 25 Apr 2023 03:33:48 +0000 (20:33 -0700)]
Build Mono LLVM legs on the CBL-Mariner images, but run the AOTing steps on CentOS Stream 8 with binutils (#85273)

18 months agoAdd Parallel.ForAsync (#84804)
Stephen Toub [Tue, 25 Apr 2023 02:51:18 +0000 (22:51 -0400)]
Add Parallel.ForAsync (#84804)

* Add Parallel.ForAsync

* Apply suggestions from code review

Co-authored-by: Carlos Sánchez López <1175054+carlossanlop@users.noreply.github.com>
---------

Co-authored-by: Carlos Sánchez López <1175054+carlossanlop@users.noreply.github.com>
18 months agoFix perf regressions in Utf8Formatter for integers (#85277)
Stephen Toub [Tue, 25 Apr 2023 02:50:59 +0000 (22:50 -0400)]
Fix perf regressions in Utf8Formatter for integers (#85277)

When I added UTF8 support to the core numeric types, I also just routed Utf8Formatter to use the public TryFormat API on each type.  That, however, regressed some microbenchmarks due to a) going from `StandardFormat` to a `ReadOnlySpan<char>` format and then parsing it back out and b) removing some of the inlining that was there previously.  This change puts back into Utf8Formatter.TryFormat the handling of the format and then delegating to the relevant helpers that already exist rather than always going through the public entrypoint (it doesn't do so for 'n', but that's also much rarer to use on a hot path and is also in general more expensive).

18 months agoAdd CollectionsMarshal.SetCount(list, count) (#82146)
Michał Petryka [Tue, 25 Apr 2023 01:14:10 +0000 (03:14 +0200)]
Add CollectionsMarshal.SetCount(list, count) (#82146)

* Add CollectionsMarshal.SetCount(list, count)

Adds the ability to resize lists, exposed in
CollectionsMarshal due to potentially risky
behaviour caused by the lack of element initialization.

Supersedes #77794.

Fixes #55217.

* Update XML doc

* Add missing using

* Fix test

* Update CollectionsMarshalTests.cs

* Update CollectionsMarshal.cs

* Update CollectionsMarshalTests.cs

* Update CollectionsMarshalTests.cs

18 months ago[native-library] If a dllimport is specified with an absolute path, look for it first...
Aleksey Kliger (λgeek) [Tue, 25 Apr 2023 00:49:02 +0000 (20:49 -0400)]
[native-library] If a dllimport is specified with an absolute path, look for it first (#85255)

The unmanaged native library probing documentation says to try
absolute paths without variations

https://learn.microsoft.com/en-us/dotnet/core/dependency-loading/default-probing#unmanaged-native-library-probing

18 months agoAdd parsing error information to composite format string parsing exceptions (#85106)
Stephen Toub [Tue, 25 Apr 2023 00:29:35 +0000 (20:29 -0400)]
Add parsing error information to composite format string parsing exceptions (#85106)

* Add parsing error information to composite format string parsing exceptions

* Update src/libraries/System.Private.CoreLib/src/System/Text/CompositeFormat.cs

Co-authored-by: Carlos Sánchez López <1175054+carlossanlop@users.noreply.github.com>
---------

Co-authored-by: Carlos Sánchez López <1175054+carlossanlop@users.noreply.github.com>
18 months agoAdd TextWriter.FlushAsync(CancellationToken) (#84325)
Stephen Toub [Tue, 25 Apr 2023 00:28:43 +0000 (20:28 -0400)]
Add TextWriter.FlushAsync(CancellationToken) (#84325)

* Add TextWriter.FlushAsync(CancellationToken)

* Update src/libraries/System.Private.CoreLib/src/System/CodeDom/Compiler/IndentedTextWriter.cs

Co-authored-by: Carlos Sánchez López <1175054+carlossanlop@users.noreply.github.com>
---------

Co-authored-by: Carlos Sánchez López <1175054+carlossanlop@users.noreply.github.com>
18 months agoPass resource item to workload task (#85264)
Jacques Eloff [Mon, 24 Apr 2023 23:32:16 +0000 (16:32 -0700)]
Pass resource item to workload task (#85264)

18 months agoAdd exceptions to TAR extended attribute constructors to disallow '=' and '\n' charac...
Carlos Sánchez López [Mon, 24 Apr 2023 23:24:29 +0000 (16:24 -0700)]
Add exceptions to TAR extended attribute constructors to disallow '=' and '\n' characters in keys and values. (#82812)

* Prevent adding extended attribute keys containing '=', '\n', or values containing '\n'.

* Add tests to verify that the PaxTarEntry and PaxGlobalExtendedAttributesTarEntry constructors that take an extended attributes dictionary, throw when a disallowed character is found.

* Apply CR suggestions

* Use enumerator to iterate items in the specified enumeration, and insert them to the lazily created dictionary if they pass the validations.

* Change IndexOf with Contains

---------

Co-authored-by: carlossanlop <carlossanlop@users.noreply.github.com>
18 months agoJIT: Move some BasicBlock methods into block.cpp (#85224)
Andy Ayers [Mon, 24 Apr 2023 22:48:17 +0000 (15:48 -0700)]
JIT: Move some BasicBlock methods into block.cpp (#85224)

Collect up a few `BasicBlock` methods that were scattered about in other files.

18 months agoUse double VectorTableLookup on ARM in ProbabilisticMap (#85189)
Miha Zupan [Mon, 24 Apr 2023 22:33:45 +0000 (00:33 +0200)]
Use double VectorTableLookup on ARM in ProbabilisticMap (#85189)

* Avoid scalar fallback for logical right shift on Arm

* Use double VectorTableLookup on ARM in ProbabilisticMap

* Revert 3bfd7d3f82c8256c2d7d7ce9371de679d961df96

18 months agoSkip covariant checks for ldelema T[] with T exact
Egor Bogatov [Mon, 24 Apr 2023 21:27:15 +0000 (23:27 +0200)]
Skip covariant checks for ldelema T[] with T exact

18 months ago[browser] Enable threads in Wasm SDK (#85109)
Marek Fišera [Mon, 24 Apr 2023 19:54:29 +0000 (21:54 +0200)]
[browser] Enable threads in Wasm SDK (#85109)

Co-authored-by: Aleksey Kliger (λgeek) <akliger@gmail.com>
18 months agoAdd metadata update for overrides (#85182)
Fan Yang [Mon, 24 Apr 2023 19:52:25 +0000 (15:52 -0400)]
Add metadata update for overrides (#85182)

18 months agoOptimize >>> to ShiftRightLogical on arm64 (#85258)
Egor Bogatov [Mon, 24 Apr 2023 19:35:38 +0000 (21:35 +0200)]
Optimize >>> to ShiftRightLogical on arm64 (#85258)

18 months agoAdding TimeProvider CreateCancellationTokenSource extension method (#85131)
Tarek Mahmoud Sayed [Mon, 24 Apr 2023 18:47:16 +0000 (11:47 -0700)]
Adding TimeProvider CreateCancellationTokenSource extension method (#85131)

18 months agoFix superpmi.py to not cache local MCH files (#85187)
Bruce Forstall [Mon, 24 Apr 2023 18:11:43 +0000 (11:11 -0700)]
Fix superpmi.py to not cache local MCH files (#85187)

When an MCH file is specified via the `-mch_file` argument,
if that file is local (not on a UNC Windows share, on Windows),
then don't copy it to the MCH file cache.

This behavior -- to avoid caching local files -- was altered
with https://github.com/dotnet/runtime/pull/56871, but it's
not clear from that PR if it was required for something or
was something used for testing that wasn't reverted before merge.
I'm guessing the latter since the code was simply commented out.

18 months agoExpose AVX512 variants of AVX, AVX2, and FMA instructions (#85228)
Tanner Gooding [Mon, 24 Apr 2023 18:08:17 +0000 (11:08 -0700)]
Expose AVX512 variants of AVX, AVX2, and FMA instructions (#85228)

* Expose various Broadcast methods for Avx512F, Avx512BW, and Avx512DQ

* Expose ExtractVector128/256 and InsertVector128/256 methods for Avx512F and Avx512DQ

* Expose ShiftLeftLogicalVariable, ShiftRightArithmeticVariable, and ShiftRightLogicalVariable on Avx512F and Avx512BW

* Expose various FusedMultiplyAdd APIs for Avx512F

* Expose various Permute intrinsics for Avx512F, Avx512F.VL, Avx512BW, and Avx512BW.VL

* Add a cpuid check for AVX512_VBMI

* Add various Permute intrinsics for Avx512Vbmi and Avx512Vbmi.VL

* Apply formatting patch

* Ensure Avx512Vbmi is recognized

* Fixup the InstructionSetDesc for Avx512Vbmi

* Update JIT/EE Version Identifier

* Fix casing in InstructionSetDesc

18 months ago[wasm] System.Net.WebSockets.Client.Tests timeouts (#85167)
Pavel Savara [Mon, 24 Apr 2023 16:51:08 +0000 (18:51 +0200)]
[wasm] System.Net.WebSockets.Client.Tests timeouts (#85167)

Co-authored-by: Marek Fišera <mara@neptuo.com>
18 months ago[wasm] Add PackedSimd saturating integer arith. (#85043)
Radek Doulik [Mon, 24 Apr 2023 16:50:09 +0000 (18:50 +0200)]
[wasm] Add PackedSimd saturating integer arith. (#85043)

* [wasm] Add PackedSimd saturating integer arith.

* Add doc comments

18 months ago[mono][debugger] Improving debugger functionaties (#85050)
Thays Grazia [Mon, 24 Apr 2023 16:11:24 +0000 (13:11 -0300)]
[mono][debugger] Improving debugger functionaties (#85050)

* Improve debugger functionalites

* Fix step over in the end of a method

* Implement MDBGPROT_CMD_TYPE_SET_VALUES_BY_FIELD_TOKEN

* removing unrelated change.

* Remove mscordbi from CI

* remove mscordbi from ci

* fixing tests because the behavior was changed

* Revert this change

18 months agoRemove unused code for PBKDF2 on Android (#83639)
Kevin Jones [Mon, 24 Apr 2023 15:46:05 +0000 (11:46 -0400)]
Remove unused code for PBKDF2 on Android (#83639)

18 months agoSpecial-case enums in Utf8.TryWrite handler (#85196)
Stephen Toub [Mon, 24 Apr 2023 15:37:30 +0000 (11:37 -0400)]
Special-case enums in Utf8.TryWrite handler (#85196)

Until we implement the Enum.TryFormat overload that targets UTF8, special-case enums in Utf8.TryWrite's handler to use the UTF16 TryFormat in order to avoid boxing the enum.

18 months agoUpdate dependencies from https://github.com/dotnet/roslyn-analyzers build 20230423...
dotnet-maestro[bot] [Mon, 24 Apr 2023 14:51:52 +0000 (09:51 -0500)]
Update dependencies from https://github.com/dotnet/roslyn-analyzers build 20230423.2 (#85248)

Microsoft.CodeAnalysis.Analyzers , Microsoft.CodeAnalysis.NetAnalyzers
 From Version 3.3.5-beta1.23222.2 -> To Version 3.3.5-beta1.23223.2

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
18 months agoUpdate dependencies from https://github.com/dotnet/arcade build 20230424.1 (#85247)
dotnet-maestro[bot] [Mon, 24 Apr 2023 14:50:24 +0000 (09:50 -0500)]
Update dependencies from https://github.com/dotnet/arcade build 20230424.1 (#85247)

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.23222.1 -> To Version 8.0.0-beta.23224.1

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
18 months agoUse emit-based invoke for all of WASM including DI (#85065)
Steve Harter [Mon, 24 Apr 2023 14:09:28 +0000 (09:09 -0500)]
Use emit-based invoke for all of WASM including DI (#85065)

18 months ago[mono] refactor metadata update code (#85177)
Fan Yang [Mon, 24 Apr 2023 13:33:55 +0000 (09:33 -0400)]
[mono] refactor metadata update code (#85177)

* WIP: remove mono_class_set_metadata_update_info generics blocker

* Allow GTDs to store MonoClassMetadataUpdateInfo

   allow generic type definitions to can contain added members

* [loader] Use iterator in find_method_in_class

   Instead of using a for-loop, use an interator that will also pick up added methods from hot reload.

   There's an issue here compared to the old code: the old code could cope with MonoClass:methods containing null pointers.  But the iterator approach signals that iteration is finished by returning NULL.

   Need to check whether the old code is reachable on modern .NET

* Get method add/update info for generic instance classes

* Cleanup the codepath of calling hot_reload_find_method_by_name

* Add reflection support for property of generic instance

* Fix ios build failure

* Add new capabilities

Fixes https://github.com/dotnet/runtime/issues/82792
Fixes https://github.com/dotnet/runtime/issues/82791

---------

Co-authored-by: Aleksey Kliger <alklig@microsoft.com>
18 months agoRemove common tests from the Roslyn3.11 test project. (#85165)
Eirik Tsarpalis [Mon, 24 Apr 2023 13:19:41 +0000 (14:19 +0100)]
Remove common tests from the Roslyn3.11 test project. (#85165)

* Remove shared tests from the Roslyn3.11 test project.

* Decouple Roslyn3.11 smoke tests from shared test classes.

* Fix project file order.

18 months agoFix compiling errors within LoongArch64 and RISCV64 for `ins_Move_Extend`. (#85216)
Qiao Pengcheng [Mon, 24 Apr 2023 11:08:13 +0000 (07:08 -0400)]
Fix compiling errors within LoongArch64 and RISCV64 for `ins_Move_Extend`. (#85216)

* Fix compiling errors within LA64 and RISCV64 for `ins_Move_Extend`.

* update for CR.

18 months ago[mono] remove unneeded PKG_CONFIG_PATH for FreeBSD (#84062)
Thefrank [Mon, 24 Apr 2023 10:41:57 +0000 (03:41 -0700)]
[mono] remove unneeded PKG_CONFIG_PATH for FreeBSD (#84062)

18 months agoAlmost complete sync of logic for generating DAM/RUC reflection access warnings betwe...
Vitek Karas [Mon, 24 Apr 2023 10:34:17 +0000 (03:34 -0700)]
Almost complete sync of logic for generating DAM/RUC reflection access warnings between ILLink and NativeAOT (#84770)

This enables the last of the disabled `RequiresCapability` tests for NativeAOT.

The implementation basically copies the logic from ILLink on how to produce warnings when method or field is marked due to reflection access.

We decided that producing warnings due to reflection access to compiler generated methods is more trouble than benefit and thus we won't do that anymore. See reasoning in https://github.com/dotnet/runtime/issues/85042.

Otherwise the behavior in NativeAOT fully copies the one in ILLink (small exceptions due to better method overload resolution in NativeAOT).

High-level behavior changes in NativeAOT:
* Finally allow the NativeAOT compiler to produce IL2110, IL2111, IL2113 and IL2115
* Avoid generating warnings for override methods if the warning is already generated on the base method (for DAM marking)
* Implement correct marking (and warnings) for "DAM on type" when the derived class has broader annotation than the base class/interface (this is mostly to avoid noise warnings)
* Rename a set of methods and classes in data flow scanner to "Token", because they're only used when a given entity is accessed through its token (so `ldtoken` and similar). This allows for more precise handling of the cases above.

Testing changes:
* Allow specifying tool exceptions for `SkipKepItemsValidationAttribute` - this allows to enable one of the reflection tests for its diagnostics coverage, avoiding the necessity to fix everything around Kept behavior yet.
* Couple of fixes in the test validator to correctly compare expected/actual diagnostics

This fixes final bits of https://github.com/dotnet/runtime/issues/68786
Fixes https://github.com/dotnet/runtime/issues/68688
This helps with https://github.com/dotnet/runtime/issues/82447

18 months ago[LoongArch64] fix the assertion error: 'numPlacedArgLocals < ArrLen(placedArgLocals...
Qiao Pengcheng [Mon, 24 Apr 2023 09:53:58 +0000 (05:53 -0400)]
[LoongArch64] fix the assertion error: 'numPlacedArgLocals < ArrLen(placedArgLocals)'. (#85238)

18 months ago[wasi] implement ICU bundling (#85049)
Pavel Savara [Mon, 24 Apr 2023 09:17:15 +0000 (11:17 +0200)]
[wasi] implement ICU bundling (#85049)

* InvariantGlobalization
* fix unbundled sample

18 months agoSkip libs native runtime packages build in source-index-stage job (#85239)
Viktor Hofer [Mon, 24 Apr 2023 09:15:53 +0000 (11:15 +0200)]
Skip libs native runtime packages build in source-index-stage job (#85239)

* Revert "Fix source-index-stage1 official build (#85215)"

This reverts commit e0e1085528f3c7febf757580b8cee781b986cf54.

* Skip libs native runtime packages in source-index-stage job

Fixes official build regression introduced in
21fb96b6ee011576d3db184765658bb1bc9c178d

18 months ago[LoongArch64] fix the errors for mod/div after #82924. (#85140)
Qiao Pengcheng [Mon, 24 Apr 2023 08:06:00 +0000 (04:06 -0400)]
[LoongArch64] fix the errors for mod/div after #82924. (#85140)

18 months agoUpdate ECMA-335 for function pointer changes (#84962)
Michal Strehovský [Mon, 24 Apr 2023 06:40:39 +0000 (15:40 +0900)]
Update ECMA-335 for function pointer changes (#84962)

#81006 changes the meaning of function pointer types.

18 months ago[mono] fix two call get_default_jit_mm make hotreload work in non default alc (#84247)
D.S. Qiu [Sun, 23 Apr 2023 20:38:14 +0000 (04:38 +0800)]
[mono] fix two call get_default_jit_mm make hotreload work in non default alc (#84247)

* mono_runtime_delegate_invoke wrapper with MONO_ENTER_GC_UNSAFE/MONO_EXIT_GC_UNSAFE;

mono_runtime_delegate_invoke wrapper with MONO_ENTER_GC_UNSAFE/MONO_EXIT_GC_UNSAFE;

* Update object.c

* add mono_alc_foreach

* implmented mono_alc_foreach

* Update loader-internals.h

* fix get_default_jit_mm()

* fix compiler error

* fix type cast

* fix compile error

* change mono_alc_foreach to mono_alc_get_all

* Update assembly-load-context.c

* Update interp.c

* fix

18 months agoAdd public Encoding.TryGetBytes/Chars (#85120)
Stephen Toub [Sun, 23 Apr 2023 19:12:31 +0000 (15:12 -0400)]
Add public Encoding.TryGetBytes/Chars (#85120)

18 months agoFix source-index-stage1 official build (#85215)
Viktor Hofer [Sun, 23 Apr 2023 18:16:02 +0000 (20:16 +0200)]
Fix source-index-stage1 official build (#85215)

With https://github.com/dotnet/runtime/commit/21fb96b6ee011576d3db184765658bb1bc9c178d, the libs.native subset is now required to be built as well for the source-index-stage1 leg.

18 months agoSet `GTF_GLOB_REF` in `gtNewIndir` (#85204)
SingleAccretion [Sun, 23 Apr 2023 18:08:44 +0000 (21:08 +0300)]
Set `GTF_GLOB_REF` in `gtNewIndir` (#85204)

18 months agoUpdate dependencies from https://github.com/dotnet/roslyn-analyzers build 20230422...
dotnet-maestro[bot] [Sun, 23 Apr 2023 17:46:49 +0000 (19:46 +0200)]
Update dependencies from https://github.com/dotnet/roslyn-analyzers build 20230422.2 (#85219)

Microsoft.CodeAnalysis.Analyzers , Microsoft.CodeAnalysis.NetAnalyzers
 From Version 3.3.5-beta1.23221.1 -> To Version 3.3.5-beta1.23222.2

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
18 months agoUpdate dependencies from https://github.com/dotnet/arcade build 20230422.1 (#85218)
dotnet-maestro[bot] [Sun, 23 Apr 2023 17:45:10 +0000 (19:45 +0200)]
Update dependencies from https://github.com/dotnet/arcade build 20230422.1 (#85218)

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.23221.8 -> To Version 8.0.0-beta.23222.1

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
18 months agoReturn int.MaxValue in GC.GetGeneration(nongc_obj) and same for profiler's GetObjectG...
Egor Bogatov [Sun, 23 Apr 2023 14:59:55 +0000 (16:59 +0200)]
Return int.MaxValue in GC.GetGeneration(nongc_obj) and same for profiler's GetObjectGeneration (#85017)

18 months agoAdd a test for STORE_DYN_BLK(..., IND(null), ...) (#85103)
SingleAccretion [Sun, 23 Apr 2023 10:00:36 +0000 (13:00 +0300)]
Add a test for STORE_DYN_BLK(..., IND(null), ...) (#85103)

18 months agoEnable `StripSymbols` by default (#85139)
Michal Strehovský [Sun, 23 Apr 2023 07:24:39 +0000 (16:24 +0900)]
Enable `StripSymbols` by default (#85139)

See discussion in https://github.com/dotnet/sdk/pull/31739#discussion_r1164126543.

18 months agoImprove ProbabilisticMap performance for small value sets (#85202)
Miha Zupan [Sun, 23 Apr 2023 02:41:50 +0000 (04:41 +0200)]
Improve ProbabilisticMap performance for small value sets (#85202)

18 months agoFix typo (#85210)
Joseph Musser [Sun, 23 Apr 2023 02:40:51 +0000 (19:40 -0700)]
Fix typo (#85210)

18 months agoSupport non core types for signature and other type references (#85112)
Buyaa Namnan [Sun, 23 Apr 2023 00:49:47 +0000 (17:49 -0700)]
Support non core types for signature and other type references (#85112)

* Support non core types for signature and other type references

* Add handle to TypeBuilderImpl and implement MetadataToken, remove callbacks

* Remove unnecessary MetadataHelper type

18 months agoAdding Shuffle(). (#85129)
DeepakRajendrakumaran [Sat, 22 Apr 2023 23:48:08 +0000 (16:48 -0700)]
Adding Shuffle(). (#85129)

* Adding Shuffle().

* Fixing Vector256 bug + Simplifying logic by switching to AND instead of ConditionalSelect

* Adding regression test.