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

Ensure the size of Vector<T> takes COMPlus_EnableHWIntrinsic into account #38879

Closed
wants to merge 251 commits into from

Conversation

tannergooding
Copy link
Member

No description provided.

@Dotnet-GitSync-Bot Dotnet-GitSync-Bot added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Jul 7, 2020
stephentoub and others added 29 commits July 7, 2020 19:41
Add zoneinfo data for System.Runtime.TimeZoneInfoTests
* Include dotnet.timezones.blat in runtime pack
* Adding enable-zoneinfo to runscriptcommand in tests.mobile.targets
* add mono_wasm_load_data to library-mono.js

Co-authored-by: Larry Ewing <[email protected]>
…sageHandler (dotnet#38733)

All of the tests start a socket-based loopback server which doesn't work on WebAssembly.
We can do the tests using a custom HttpMessageHandler instead of the loopback server as well.
* Add examples of System.Private.CoreLib iterative workflow

* Update build.sh

* PR Feedback
* Disable retyping by default.

* Keep block init/copy as baseline.

Total bytes of diff: -21971 (-0.07% of base)
3075 total methods with Code Size differences (1589 improved, 1486 regressed), 184523 unchanged.

Note: it improves code with retyping as well:
808 total methods with Code Size differences (808 improved, 0 regressed), 186790 unchanged.
Found 55 files with textual diffs.
Crossgen CodeSize Diffs for System.Private.CoreLib.dll, framework assemblies for  default jit
Summary of Code Size diffs:
(Lower is better)
Total bytes of diff: -22923 (-0.07% of base)

* Don't mark LCL_VAR that is used in RETURN(IND(ADDR(LCL_VAR)) as address taken when possible.

Protect against a promoted struct with a hole like struct<8> {hole 4; int a;};

* Replace 1-field structs with the field for returns.

* Add SSA support.

* Review response.

* isOpaqueSIMDLclVar fix

* Add tests for structs with independently promoted SIMD fields.

* Old retyping fix.

* Don't try to replace SIMD fields.
- UnboxingMethodDesc is a type that is not intended to escape JIT
interface
- This fix is a combination of 2 changes.
  - First, a change for creation of ldtoken to a generic valuetype method
  - Second, moving a bool to indicate whether or not a method is an
  unboxing stub into the MethodWithToken data structure instead of
  passing it as a side parameter everywhere
- Also, a test case for various generic ldtoken cases is added to
crossgen2smoke
- And, minor fix to make single method compilation of a generic method
function correctly. (There was a typo)
`Instr` objects come from a static pool and should not be deleted
with `delete`. Instead, they are marked no longer used by setting
their `opcode` field to -1.

Fixes dotnet#12433
* fix failing tests

* fix casing

* feedback from review

* style update

* retire EndEntityIsServer
* logging

* the fix

* revert lclvars.cpp changes

* Revert "revert lclvars.cpp changes"

This reverts commit d39af7084687e8fe5e6d4f71674ec84d36a88340.

* wip

* revert lclvars.cpp changes

* deleted inst_RV_ST()

* removing logging, added some asserts

* jit-formatting

* add back case of INS_add and some more asserts

* reset lclvars.cpp

* delete comments and cleanup code

* revert changes inside common.il

* Revert "Disable failing Windows arm32 tests (dotnet#38844)"

This reverts commit 311fd81.

* review comments

* added standard function header
The finalization queue can be long or constantly growing when the finalization thread is not able to
keep up with finalizable object allocation rate. This can lead to shutdown being blocked for a long
time or indefinitely.

The fix is stop the finalization loop once we enter shutdown instead of trying to empty the finalization
queue.

Fixes dotnet#314
)

* Reenable GitHub_26491.

Closes dotnet#13355

* Reenable crossgen2 tests failing with old retyping/

They were fixed both with and without retyping.
Closes dotnet#37883.

* Reenable HVA merge cases.

Closes dotnet#37341, closes dotnet#37880.

* Reenable GitHub_35821.

Closes dotnet#36206, closes dotnet#36418.

The issue was fixed by dotnet#37499.

* Delete extra lines that are no longer needed.

dotnet#37506 was fixed in dotnet#38241.

* delete a throwing init.
…net#38058)

* Mechanical move of tests from src/coreclr/tests/src to src/tests

* Minimum changes to make CoreCLR tests build in the new location

(*) Path changes in the test build scripts;
(*) Modify runtime.yml filtering based on Nathan's and Santi's feedback;
(*) Fix runtime pipeline filtering clauses per Santi's PR feedback;
(*) Fix path to Coreclr.TestWrapper.csproj;
(*) Pass unprocessed build args to test wrapper creation;
(*) Fix missing $(TestRoot) on groups in Pri0 test build mode.

Thanks

Tomas
* [interp] Remove usage of some gotos

Their usage resulted in worse code on wasm.

* [interp] Rename method

Seems like something is failing in eglib-remap test
The global .gitignore ignores `Makefile` since it's typically just a build artifact of CMake/automake.
However we have a few real Makefiles in src/mono that were excluded by this, resulting in VSCode's search not looking in them.
…#38866)

* Avoid unnecessary CultureInfo.CurrentCulture accesses in Enum

Enum can only be backed by primitive numerical types, and using the IConvertible interface implementations to convert to numerical types won't pay any attention to culture, so just as there's no need to pass through the supplied provider, there's no need to access CultureInfo.CurrentCulture.

* Address PR feedback
Saw these missing while reviewing dotnet#37944.
As far as I can see this is only used when building inside VS but still good to add for consistency.
…s debug information (dotnet#38869)

Considering DebugDirectoryEntryType = Reproducible as an assembly that has debug information.

Fixes mono/mono#20075

Co-authored-by: thaystg <[email protected]>
CarolEidt and others added 26 commits July 14, 2020 21:28
- Unify the handling of promoted args when assigning offsets; there's no need to handle independent vs. dependent promotion separately.
- Use `varTypeUsesFloatReg` where appropriate.
- Some minor refactoring of initial reg assignment.
- Add a 'Clear' method to `StructPromotionHelper` for use after inlining (not yet in use, as it produces diffs).
- Wrap a SIMD field node in `GT_OBJ` only if needed.
These changes are preparatory to improved struct promotion for args.
Recognize `get_AllBitsSet` instead of `get_AllOnes`; this internal
intrinsic was renamed in dotnet#36579
(1c66ad1).

Implement `Vector<T>.One` as an intrinsic.
* Porting new netfx configurations for packages

* Add Netfx configurations to Microsoft.Extensions and missing System packages

* Making sure net461 configurations build against targeting pack assembly versions

* Undo changes to add netfx configurations on reference projects that don't ship in their package

* Fix issue with M.E.FP.P package by removing NetStandard.Library metapackage dependency

* Fix issues with depending on higher version than the one available in net461

* Disable UTF8String verifyClosure on package

* Undo changes to Microsoft.XmlSerializer.Generator

* Update src/libraries/Microsoft.Extensions.FileProviders.Physical/src/Microsoft.Extensions.FileProviders.Physical.csproj

Co-authored-by: Eric StJohn <[email protected]>

Co-authored-by: Eric StJohn <[email protected]>
PAL_VirtualUnwindOutOfProc for MacOS

Add MacOS compact unwind section parsing (__unwind_info) and stepping: SearchCompactEncodingSection, SearchDwarfSection, GetProcInfo, StepWithCompactEncoding*.

Add back some (from a previous commit) of the dwarf unwind info parsing functions to use for the dwarf unwind info (__eh_frame section): ReadValue*, ReadULEB128, ReadSLEB128, ReadEncodedPointer, ParseCie, ExtractFde, ExtractProcInfoFromFde. These functions were used and fairly well tested in 3.x.

Build libunwind8 source on MacOS for those dwarf unwind info cases.

The methoddesc's enum memory region code needed add more of the code version manager's data to the coredump.
…tnet#39316)

The previous code would convert exceptions into errors which would
be rethrown later, clearing the resume state.

Hopefully fixes dotnet#38337.

Co-authored-by: vargaz <[email protected]>
One test failed with an issue: dotnet#39311

Also noticed that StringTests.cs is included from the CommonPath, this is a historical artifact from when System.Memory built for netfx/netstandard so we could run tests on those configs.
We no longer need it since StringTests.cs is already ran in System.Runtime.Tests.
* Update dependencies from https://github.com/mono/linker build 20200713.5

Microsoft.NET.ILLink.Tasks
 From Version 5.0.0-preview.3.20361.1 -> To Version 5.0.0-preview.3.20363.5

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

Microsoft.NETCore.Runtime.ICU.Transport
 From Version 5.0.0-preview.8.20359.7 -> To Version 5.0.0-preview.8.20364.1

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
* IDL Change

* Store generated code for ICorDebugProcess11

* Implement ICorDebugProcess11

* PR Feedback

* Fix clang builds
…otnet#39280)

This change ensures correct unwinding of stack when stepping through
these methods under a debugger.
With this change:

* Building up hashes, piecemeal: IncrementalHash
* One-shot hashes, polymorphically: HashAlgorithm.ComputeHash
* One-shot hashes, statically: [Algorithm].HashData
…aining thunks (dotnet#39063)

* [Crossgen2] Add DelayLoadMethodCallThunks table, fix stack walks containing thunks

GC stress runs with Crossgen2 binaries frequently see AVs with stack-walk failures. This occurs when a delay load thunk is being executed as a stack-walk is performed. The runtime resolves any thunk address to the code info for the last managed method in the runtime functions table.

Use the `DelayLoadMethodCallThunks` header entry to avoid finding an R2R method when the actual IP address is for a stub. The issue is that the binary search algorithm in `NativeUnwindInfoLookupTable::LookupUnwindInfoForMethod` which doesn't correctly return -1 if the code address being searched for is larger than any present. That issue cannot easily be fixed inside of that routine as identifying the end of a function via the `RUNTIME_FUNCTION` structure is slow on some platforms and impossible on others (Windows X86). This old bug was not hit because Crossgen emits stubs earlier in the image than managed code, whereas the two are reversed with Crossgen2.

Fix generation of the RuntimeFunctionsTable so that the terminating sentinel node is not treated as part of the table in the R2R header entry for the table. This was causing the sentinel node to be treated as its own runtime function by the runtime and could lead to reading beyond the table bounds in `NativeUnwindInfoLookupTable::LookupUnwindInfoForMethod`. The bug in the binary search of the table hid this bug until now.

Add the `DelayLoadMethodCallThunks` header entry. `DelayLoadMethodCallThunkNodeRange` is a placeholder node (not an `ObjectNode`) to provide a symbol to relocate against from the header. It represents the range of import thunks. Add support to the object writer for defining a range between two symbols in the same section. The relocation phase can then resolve the difference between the two symbols to determine the range size.

Fixes dotnet#38482

Co-authored-by: David Wrighton <[email protected]>
* use arm64 intrinsics in FindFirstCharacterToEncodeUtf8

* remove whitespace

* shim intrinsics apis for netstandard & netcoreapp targets

* use shimmed APIs in DefaultJavascripEncoder.cs

* implement MoveMask over AdvSimd

* Fix build and remove x86 shims

* remove stub goto labels

* implement optimizations for FindFirstCharacterToEncodeUtf8

* optimize FindFirstCharacterToEncode

* fix bug

* implement optimizations for FindFirstCharacterToEncodeUtf8

* remove goto labels

* optimize FindFirstCharacterToEncode

* Optimiize FindFirstCharacterToEncodeUtf8

* bug fix

* add missing shim methods

* fix bug

* minor cleanups

* cleanup and add comments

* address feedback

* address feedback and add checks for endianness

* address feedback

* Use shims from CoreLib

* Remove AdvSimdHelper.MoveMask and factor non-ascii byte locator logic into architecture-specific helper methods

* address feedback

* reinstate goto labels

* revert removed goto labels

* revert more changes

* address feedback

* address feedback

* further optimize GetIndexOfFirstNonAsciiByte

* add TODO comment
…net#39237)

* Remove debug only attributes when Debugger.IsSupported is false.

Contributes to dotnet/linker#1093

* Move debug only attributes to shared CoreLib.
* [interp] Fix definition of instruction

* [interp] Intrinsify span ctor

It is heavily used in bcl for static read only spans.

In the future we should do copy propagation through its fields so we avoid creating the span in the first place and remove other unecessary opcodes.

* [interp] Allow method inlining if constructor is intrinsified

* Fix case where has_references is not yet initialized
@tannergooding
Copy link
Member Author

Something got out of sync with GitHub here, the same branch resubmitted in a new PR (with no changes) is as expected: #39368

@ghost ghost locked as resolved and limited conversation to collaborators Dec 8, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
Projects
None yet
Development

Successfully merging this pull request may close these issues.