Skip to content

Conversation

@yowl
Copy link
Contributor

@yowl yowl commented May 16, 2023

This PR is the latest merge (to 83f71b5) from runtime.

Set RUNTIME_FLAVOR=CoreCLR for build-native.cmd so that STATIC_ICU does not get set. We need all the function renaming macros such as

#define u_charsToUChars(...) u_charsToUChars_ptr(__VA_ARGS__)

from pal_icushim_internal.h to avoid missing symbols.

Delete the assert from the beginning of SsaBuilder::AddPhiArg

    // For LLVM backed, every predecessor must have its own phi arg
    if (!block->IsLIR())
    {
        // Make sure it isn't already present: we should only add each definition once.
        for (GenTreePhi::Use& use : phi->Uses())
        {
            assert(use.GetNode()->AsPhiArg()->GetSsaNum() != ssaNum);
        }
    }

Not sure that is ok, maybe it is fallout from the ASG refactoring that needs looking at?

Exclude LowLevelLifoSemaphore for Wasi, think its just for threading and we don't have the base LowLevelLifoSemaphoreBase

pentp and others added 30 commits May 7, 2023 18:29
Fixes #72570.

Still need to delete workarounds that make things public in corelib but maybe this diff is large enough already?

We were gradually getting less and less from reflection blocking:

* We stopped blocking things outside corelib (.NET Native blocked all of BCL; we don't).
* We trim reflection metadata and that allows us to have method bodies without metadata.

With this, we should be able to get type definition-level reflection metadata for any MethodTable there is in the system.

This is a ~30 kB size regression for BasicMinimalApis. It is pretty much a wash for Hello World, because all the BCL cruft to handle reflection blocked types costs as much as the benefit of blocking.
…e (#85153)

* [mono][interp] Refactor arg offset computation to make code clearer

* [mono][interp] Remove redundant assign

* [mono][interp] Move mint_type out from header file

It makes no sense to inline this big method into callers.

* [mono][interp] Fix arg offset computation when doing pinvoke and aot/jit calls from interp

The previous code wasn't handling alignment of simd types.

* [mono][interp] Use the correct alignment for args when entering interp

We stop computing the arguments on the fly since it's getting too expensive doing the alignment checks. We directly use `imethod->arg_offsets` instead which is computed once during the first call, while also ensuring consistency with the calculation.

* [mono][interp] Fix arg offset computation when running clauses with interp

* [mono][interp] Remove dead code

* Temporaril disable jiterp for CI

* Update jiterpreter interp_entry wrapper generator and re-enable jiterp

* Revert options-def.h changes

---------

Co-authored-by: Katelyn Gadd <[email protected]>
When the profile data comes from dynamic PGO, the spanning tree encoded in the
schema produced by an earlier tier should exactly match the spanning tree for
the current jit attempt, since the JIT and method IL are identical.

(This is not the case for static PGO; that schema may have come from a different
JIT and/or different version of IL).

Note in release modes we won't assert; instead, we will silently throw the PGO
data away.

Follow-on change to #85805 to catch more issues like #85799.
…al bailout/exit (#85905)

* Prune opcodes that follow an unconditional bailout/abort since they are unreachable and we don't need to compile them
…rating a table (#85904)

* No longer generate a typescript opcode info table
* Fetch opcode info from the interpreter on-demand
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.23255.1 -> To Version 8.0.0-beta.23255.2

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

Microsoft.CodeAnalysis.Analyzers , Microsoft.CodeAnalysis.NetAnalyzers
 From Version 3.3.5-beta1.23254.2 -> To Version 3.3.5-beta1.23256.1

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
The pre-existing behavior was copying all RVA fields in
single-file builds and only selectively copying explicitly
referenced fields in composite builds. This has bitten us
in WPF where Managed C++ emits an array of early initializers
that are marked by an initial and final RVA field. By only
selectively copying those two without the remaining entries
in-between we end up crashing later on as the app is not
fully initialized.

Based on David Wrighton's advice I have kept the logic for
copying RVA fields in case of array initializers that seem
to be hot in terms of performance. For the remaining field
access I have ended up constructing a new precode fixup
RVA_FIELD_ADDRESS for this purpose.

Fixes: #78723

Thanks

Tomas

Co-authored-by: Jan Kotas <[email protected]>
BasicMinimalApi spends about 1% of samples in this method.
* Ensure the insTupleType mask entries stay correct

* Ensure the bitwise result remains uint16_t
…install installing a broken urllib version. (#85935)
* Servicing docs improvements

* Apply suggestions from code review

* Apply suggestions from code review

* Apply suggestions from code review

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

* Apply suggestions from code review

* Update .github/workflows/check-service-labels.yml

* Update .github/workflows/check-service-labels.yml

---------

Co-authored-by: Carlos Sánchez López <[email protected]>
Co-authored-by: Juan Hoyos <[email protected]>
I think this is a leftover from one of the appmodels that we deleted. I don't believe this ever returns non-empty enumeration.
…#85866)

* Update dependencies from https://dev.azure.com/dnceng/internal/_git/dotnet-optimization build 20230505.3

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.23254.3 -> To Version 1.0.0-prerelease.23255.3

* Update dependencies from https://dev.azure.com/dnceng/internal/_git/dotnet-optimization build 20230506.3

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.23254.3 -> To Version 1.0.0-prerelease.23256.3

---------

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Instead of going to great lengths to keep the ref counts correct in
physical promotion just stop using them in forward sub. The last use
information generalizes what forward sub needs except for when the
tracking limit is reached, which shows in the improvements we actually
get from consulting the ref counts -- the improvements are very modest
and in tests only.

This makes early liveness the only consumer of the "regular" ref counts
computed by local morph. Weighted ref counts are still used for undoing
regular promotion of implicit byref parameters.
Fix a couple of cases where it's possible that the decomposed stores
will modify the address being used as part of the operation too early.
In those cases we must spill the address to a new local ahead of time.

Fix #85874
This test has failed across many configurations, but apparently only
on Windows. Tracked by dotnet/runtime#84006,
dotnet/runtime#83658.
* Do not generate PerfMap entries for methods we didn't compile

dotnet/installer#16318 is currently blocked due to crossgen2 crash. While Jan (dotnet/installer#16318 (comment)) is totally right that the command line to crossgen2 is garbage, we should try not to crash. Based on the stack we already emitted the PE and PDB. The crash seems to be caused by attempting to include methods that didn't successfully compile in the perfmap (`EnumerateCompilerMethods` has an `IsEmpty` check whereas walking all nodes looking for `MethodWithGCInfo` doesn't check that).

```
Internal.TypeSystem.TypeSystemException+TypeLoadException: Failed to load type 'System.Security.Policy.EvidenceBase' from assembly 'System.Security.AccessControl, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' [/__w/1/s/src/redist/redist.csproj]
    at Internal.TypeSystem.ThrowHelper.ThrowTypeLoadException(ExceptionStringID, String, String) + 0x39 [/__w/1/s/src/redist/redist.csproj]
    at Internal.TypeSystem.ResolutionFailure.Throw() + 0x99 [/__w/1/s/src/redist/redist.csproj]
    at Internal.TypeSystem.Ecma.EcmaModule.GetObject(EntityHandle, NotFoundBehavior) + 0x8f [/__w/1/s/src/redist/redist.csproj]
    at Internal.TypeSystem.Ecma.EcmaModule.GetType(EntityHandle) + 0x2c [/__w/1/s/src/redist/redist.csproj]
    at Internal.TypeSystem.Ecma.EcmaType.InitializeBaseType() + 0x81 [/__w/1/s/src/redist/redist.csproj]
    at Internal.TypeSystem.Ecma.EcmaType.ComputeTypeFlags(TypeFlags) + 0x48 [/__w/1/s/src/redist/redist.csproj]
    at Internal.TypeSystem.TypeDesc.InitializeTypeFlags(TypeFlags) + 0x1e [/__w/1/s/src/redist/redist.csproj]
    at Internal.TypeSystem.TypeNameFormatter.AppendName(StringBuilder, TypeDesc) + 0x2d [/__w/1/s/src/redist/redist.csproj]
    at ILCompiler.PEWriter.TypeString.AppendName(StringBuilder, ArrayType) + 0x1b [/__w/1/s/src/redist/redist.csproj]
    at Internal.TypeSystem.TypeNameFormatter.FormatName(TypeDesc) + 0x54 [/__w/1/s/src/redist/redist.csproj]
    at ILCompiler.PEWriter.OutputInfoBuilder.FormatMethodName(MethodDesc, TypeNameFormatter) + 0x174 [/__w/1/s/src/redist/redist.csproj]
    at ILCompiler.PEWriter.OutputInfoBuilder.<EnumerateMethods>d__16.MoveNext() + 0x15f [/__w/1/s/src/redist/redist.csproj]
    at ILCompiler.Diagnostics.PerfMapWriter.Write(String, Int32, IEnumerable`1, IEnumerable`1, TargetDetails) + 0x13b [/__w/1/s/src/redist/redist.csproj]
    at ILCompiler.PEWriter.SymbolFileBuilder.SavePerfMap(String, Int32, String) + 0x1ba [/__w/1/s/src/redist/redist.csproj]
    at ILCompiler.DependencyAnalysis.ReadyToRunObjectWriter.EmitPortableExecutable() + 0xa59 [/__w/1/s/src/redist/redist.csproj]
```

This is all based on the stack trace. I didn't validate this fixes the issue (or that it compiles at all) but the fix seems legit to me.

My local workflows are affected by the installer repo break because the runtime repo had a breaking change in CoreLib that is not compatible with existing installer builds. Nobody seems to be doing anything with the failing integration PR, so this is my attempt...
…ce (#85938)

* Allow Base64Decoder to ignore space chars, add IsValid methods and tests

* Some cleanup of Base64.IsValid changes

This includes making FromBase64Transform significantly faster via SearchValues.

* Address PR feedback and some more cleanup

---------

Co-authored-by: Heath Baron-Morgan <[email protected]>
Bypass emscripten's generated js wrappers when invoking cwraps, this may improve cross-language inlining
Fix signature for a cwrap that was missing an arg
* [JIT] Fix some errors in JIT

* Fix errors in unwinding

* [JIT] Pass float value with int arg reg

* [JIT] Fix register overwriting in RSVD

* [JIT] jit-format

* Fix an error

* [JIT] Add LOONGARCH64
ilonatommy and others added 24 commits May 16, 2023 23:01
Disabled tests that are timing out on node 16.19.0. On the newer version, 19.9.0 it's already fine.
Removing timeouts uncovered a bunch of failures that are gone in the newer node as well.

Related issues: dotnet/runtime#86317, and dotnet/runtime#86326

* Active issue.

* Disable failures uncovered when timeouts are gone.
…s from base methods to generated shadowing methods (#86344)

Adds tests to ensure expected diagnostics are produced for interfaces with a Guid and generic interfaces.
Copies attributes on methods on base methods to the generated shadowing method definitions.
Adds Test type with a CompilationVerifier field of Action to make it easier to make one-off tests that verify compilations without making a new type.
…ocess. (#85649)

* ProcessTests: allow WorkingSet to be zero just after launching the process.

The WorkingSet tests fail on Fedora 38+ because a zero working set value
is observed just after the process start.
… RISC-V. (#86294)

* Fix the regs conflicts within the `addResolution` for LoongArch64/RISC-V.

* amend the code for CR.

* add terminatorNodeLclVarDsc2 for the second op2.
* Remove NativeAOT test exclusion for issue #83167

Resolves #83167.

* Update tests.proj

* Update tests.proj
…fied (#86371)

- Fix passing startupOptions to resourceLoader creation when loadBootResource is not specified
- Fix propagating applicationEnvironment
* Special-case array/list in Dictionary(IEnumerable, ...) ctors

It's reasonably common to construct a dictionary from a `KeyValuePair<TKey, TValue>[]` or a `List<KeyValuePair<TKey, TValue>>`, and we can make both cheaper.
…811)

* Initial commit to add ToDictionary() overloads for KeyValuePair and ValueTuple kv.

* Add xml doc; add tests.

* Fix comments: use Dictionary's ctor for IEnumerable<KeyValuePair<>> overload; API signature changed to nullable comparer.

* Throw ArgumentNullExp with 'source' parameter name.
Otherwise new stress modes can change what the test is testing. I
verified that these stress modes reproduced the original issue back when
the test was introduced.

Fix #86185
* Haiku: Initial configuration support

Initially recognize Haiku as a supported platform in
Directory.Build.props and all scripts in eng/**.

* Drop some unused configure values

Drop some unused configure values from tryrun.cmake,
configure.cmake and config.h.in.

* Simplify error message in build.sh

Simplified an error message for the `--os` option to avoid maintaining a duplicate list of OSes.

Co-authored-by: Adeel Mujahid <[email protected]>
…339)

Fix DAC syncblk API

Only fill in the syncblk data if there are blocks

Add SBNumber index validation to API
Remove AddPhiArg assert
…ge-15-may-23

# Conflicts:
#	src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.targets
@yowl yowl changed the title Merge 15 may 23 NativeAOT-LLVM: Merge runtime to 17 May 2023 May 18, 2023
@yowl yowl marked this pull request as ready for review May 18, 2023 14:30
@yowl
Copy link
Contributor Author

yowl commented May 18, 2023

cc @dotnet/nativeaot-llvm

@jkotas jkotas added the area-NativeAOT-LLVM LLVM generation for Native AOT compilation (including Web Assembly) label May 18, 2023
@yowl yowl closed this May 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-NativeAOT-LLVM LLVM generation for Native AOT compilation (including Web Assembly)

Projects

None yet

Development

Successfully merging this pull request may close these issues.