Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

merge with dotnet/runtime #7

Merged
merged 323 commits into from
May 4, 2023
Merged

merge with dotnet/runtime #7

merged 323 commits into from
May 4, 2023

Conversation

mphelt
Copy link
Owner

@mphelt mphelt commented May 4, 2023

No description provided.

dotnet-maestro bot and others added 30 commits April 24, 2023 09:50
…424.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>
…uild 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>
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.
* 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
* [wasm] Add PackedSimd saturating integer arith.

* Add doc comments
* 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
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 #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.
Co-authored-by: Aleksey Kliger (λgeek) <[email protected]>
* Avoid scalar fallback for logical right shift on Arm

* Use double VectorTableLookup on ARM in ProbabilisticMap

* Revert 3bfd7d3
Collect up a few `BasicBlock` methods that were scattered about in other files.
… 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 <[email protected]>
* Add TextWriter.FlushAsync(CancellationToken)

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

Co-authored-by: Carlos Sánchez López <[email protected]>

---------

Co-authored-by: Carlos Sánchez López <[email protected]>
…ptions (#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 <[email protected]>

---------

Co-authored-by: Carlos Sánchez López <[email protected]>
* 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
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).
* Add Parallel.ForAsync

* Apply suggestions from code review

Co-authored-by: Carlos Sánchez López <[email protected]>

---------

Co-authored-by: Carlos Sánchez López <[email protected]>
* Specify -z notext on linux-musl-x86

* Fix riscv64 build with clang/lld v15+

* Inline visibility attribute

* Fix gcc build
Saves 3.14% on BasicWebApi. 🤯

We run linker with COMDAT folding enabled. Generating this data into COMDAT foldable section allows linker to deduplicate these.
* Disable gcstress and jitstress

* Fix EventListenerThreadPool proj

---------

Co-authored-by: Juan Hoyos <[email protected]>
EgorBo and others added 29 commits May 3, 2023 11:41
…ase. (#85516)

* This speeds it up ~twice.

* JS's decoder always changes the codepoint.

* @kg's optimization idea.
We now have some architectures (eg, s390x and ppc64le) that produce a .NET runtime that looks and feels like any other .NET runtime, except it's using Mono instead of CoreCLR under the hood.

However, it's only possible to produce this Mono-based .NET runtime on s390x/ppc64le. That makes it hard to test this set up on other architectures. Issues that affect the mono build on all architectures - such as #66594 become harder to fix and verify because of this unnecessary architecture requirement.

Fix that by adding a flag to the top-level build.sh (and also to the msbuild projects) to make it possible to produce a .NET runtime with Mono on any platform.

The default configuration is unchanged: we still produced CoreCLR-based .NET runtime on x64 and a Mono-based runtime on s390x/ppc64le.

Fixes: #62440
Partial defs in liveness are modelled as full uses of all fields and
then a full def of the entire local. The logic that handled fields
directly got that right, but the logic that handled parent locals did
not.

For example, for IR like

```
------------ BB18 [045..046), preds={BB16} succs={BB19}

***** BB18
STMT00096 ( INL10 @ 0x01F[E-] ... ??? ) <- INL04 @ ??? <- INLRT @ 0x045[E-]
N003 (  5,  4) [000403] -A------R--                         ▌  ASG       byref
N002 (  3,  2) [000402] D------N---                         ├──▌  LCL_VAR   byref  V73 tmp45
N001 (  1,  1) [000401] -----------                         └──▌  LCL_VAR   long   V43 tmp15

***** BB18
STMT00097 ( INL10 @ 0x026[E-] ... ??? ) <- INL04 @ ??? <- INLRT @ 0x045[E-]
N003 (  5,  4) [000407] -A------R--                         ▌  ASG       int
N002 (  3,  2) [000406] D------N---                         ├──▌  LCL_VAR   int    V74 tmp46
N001 (  1,  1) [000405] -----------                         └──▌  LCL_VAR   int    V42 tmp14

***** BB18
STMT00072 ( INL04 @ 0x073[--] ... ??? ) <- INLRT @ 0x045[E-]
N007 ( 14, 14) [000627] -A---------                         ▌  COMMA     void
N003 (  7,  7) [000623] -A------R--                         ├──▌  ASG       byref
N002 (  3,  4) [000621] U------N---                         │  ├──▌  LCL_FLD   byref (P) V12 loc3         [+16]
                                                            │  ├──▌    ref    field V12._managedArray (fldOffset=0x0) -> V57 tmp29
                                                            │  ├──▌    long   field V12._allocatedMemory (fldOffset=0x8) -> V58 tmp30
                                                            │  ├──▌    byref  field V12._reference (fldOffset=0x10) -> V59 tmp31
                                                            │  ├──▌    int    field V12._length (fldOffset=0x18) -> V60 tmp32
N001 (  3,  2) [000622] -----------                         │  └──▌  LCL_VAR   byref  V73 tmp45
N006 (  7,  7) [000626] -A------R--                         └──▌  ASG       int
N005 (  3,  4) [000624] U------N---                            ├──▌  LCL_FLD   int   (P) V12 loc3         [+24]
                                                               ├──▌    ref    field V12._managedArray (fldOffset=0x0) -> V57 tmp29
                                                               ├──▌    long   field V12._allocatedMemory (fldOffset=0x8) -> V58 tmp30
                                                               ├──▌    byref  field V12._reference (fldOffset=0x10) -> V59 tmp31
                                                               ├──▌    int    field V12._length (fldOffset=0x18) -> V60 tmp32
N004 (  3,  2) [000625] -----------                            └──▌  LCL_VAR   int    V74 tmp46
```

we would see

```
BB18 USE(6)={V58 V57 V59 V60 V42 V43        }
     DEF(2)={                        V73 V74}
```

which is obviously incorrect as V57-V60 are all defined under this
model. This would lead to an assert in SSA since SSA did treat this as a
def.
Sending this for consideration. The old approach also had an advantage. Wouldn't be the end of the world if we keep that.

Before this PR, accessing dispatch map involved:
* Reading optional fields to find the field with the right tag
* The optional field contained an integer index into a table
* The index was used to index into a dispatch map table to find a pointer to the actual dispatch map
* We then followed the pointer to get to the dispatch map.

The advantage of this scheme is smaller working set (MethodTable is smaller), but this assumes the MethodTable has other optional fields (because we still need a pointer to the optional fields). Turns out most MethodTables only need optional fields pointer because of the dispatch map and if we move them to MethodTable, we no longer need an optional field pointer.

This PR simply moves the dispatch map pointer to MethodTable.

I'm seeing another 15 kB saving on BasicMinimalApi. Plus the code looks simpler.
…503.3 (#85703)

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
…et) (#85671)

* track 2nd variable offset

* display frame references for 2nd variable

* revert a change

* revert a change

* jit formnat

* fix after merge-conflict

* Consolidate ResetLclILoffs()

* fix gcc error

* fix gcc errors in arm/arm64
- The logic for referencing ILCompiler as an MSBuild SDK should no longer be needed because we use PackageReference.
- IlcCalledViaPackage should always be true
* Remove S.Sec.Crypto.Algorithms package dependency

Contributes to #85641

System.Security.Cryptography.Algorithms/4.3.1 is being referenced in a
few .NET Framework builds. The reference to that package is undesirable
as it brings in the entire netstandard 1.x dependency graph.

The only type used from that package is IncrementalHash which isn't
available as a public API in .NET Framework before 4.7.1. Because of
that, polyfill the netfx code in with minor changes to the source to
make the analyzers happy.
The previous default value, 64, doesn't work for DES because .NET only supports CFB8 for DES. Further, this more closely aligns the behavior of DES.Create() from .NET Framework to .NET, as DESCryptoServiceProvider also had a default feedback size of 8.

This change sets the default feedback size to 8, which is the only value that worked anyway, so it isn't a breaking change.

Types derived from DES will continue to have a default feedback size of 64, which is the default value for .NET Framework derived types. We are only changing the default for DESImplementation returned by DES.Create().
…ling support. (#85419)

Fixes #74035

We can't remove the built-in marshalling support from the generator yet, but once the out-of-band packages we ship don't support .NET 6. we can remove the built-in support that emits the marshalling code in the stub. I believe the .NET 9 packages won't support .NET 6, so once we snap for .NET 9 and update how we ship the packages, we can clean this up.

This PR also adds a requested feature to the SafeHandle marshaller: If the call to native code fails, we'll call Dispose() on the pre-allocated handle to avoid leaking it to the finalizer queue.
* Delete GT_FIELD

* GenTreeField -> GenTreeFieldAddr
… dotnet/emsdk dotnet/hotreload-utils (#85704)

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
…r unsupported formats (#85714)

* Fix AreFlagsSetToZeroCmp to not consider unsupported formats

* Also fix AreFlagsSetForSignJumpOpt
We switched it temporarily to specific version around 3.1.34 bump,
so get back to floating tags again
* Add back IHtmlString to System.Web.HttpUtility

* Update src/libraries/System.Web.HttpUtility/tests/HttpUtility/HttpUtilityTest.cs

Co-authored-by: Miha Zupan <[email protected]>

---------

Co-authored-by: Miha Zupan <[email protected]>
* trying to use inline reloc for win-arm64 tls

* remove arm64 INLINE_GETTHREAD_CONSTANT_POOL

* introduce INLINE_GET_TLS_VAR for win-arm64

* delete unused GetThread.asm files
…5716)

* Expose GetExponent and GetMantissa for Avx512F

* Expose Reciprocal14 and ReciprocalSqrt14 for Avx512F

* Expose RoundScale and Scale for Avx512F

* Expose Fixup for Avx512F + Range and Reduce for Avx512DQ

* Ensure the RMW handling for Fixup avoids allocating a register

* Ensure the NI_AVX512F_Fixup handling in isRMWHWIntrinsic compiles

* Ensure vrange is marked as INS_Flags_IsDstDstSrcAVXInstruction

* Apply formatting patch

* Ensure vfixupimm is correctly handled in the JIT

* Ensure FixupScalar only checks the first element when doing RMW validation
Product fixes:
* Fix tracking of arrays in NativeAOT
* Fix handling of arrays in ILLink

Test fixes:
* Consider reflection enabled methods as marked (even if they don't have an entrypoint, like interface methods)
* Fix where to look for ilasm
* Better handling of compiled dependenceis
* Ignore some more compiler generated code (which can't be marked as kept)

Enables several more data flow tests from linker for AOT as well.
Updates some bug links to point to runtime repo.
…ment decomposition (#85728)

This refactors the physical promotion to make the generalized assignment
decomposition PR more manageable to review.

* Pull Replacement and ReplaceVisitor into the header
* Introduce promotiondecomposition.cpp that deals with handling
  assignments, and move relevant code from promotion.cpp to this file
* Rename StatementList -> DecompositionStatementList and unnest it
* Rename Replacement::Name -> Replacement::Description which is more fitting

Also adds some more JITDUMPs when picking promotions, but otherwise
should not affect behavior.
@mphelt mphelt merged commit 08ecd2c into mphelt:main May 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.