Do not assert RyuJIT if InitializeArray cannot be expanded (#86373)
authorMichal Strehovský <MichalStrehovsky@users.noreply.github.com>
Thu, 18 May 2023 02:03:54 +0000 (11:03 +0900)
committerGitHub <noreply@github.com>
Thu, 18 May 2023 02:03:54 +0000 (11:03 +0900)
commit21d8f36a9bf30ebbe6d90544765ffb5dc5a2cc6d
tree960ba96323db920bdd506971fd2b2df15c09526e
parentfbe5827984a2c24a14c7620e1da91c06304a9f01
Do not assert RyuJIT if InitializeArray cannot be expanded (#86373)

Found in Pri0 tests. `RuntimeHelper.InitializeArray(default, default)` would assert RyuJIT. Do not assert.

The tests also have various invalid combinations of the intrinsic that make it difficult to do optimized builds (we don't want the target field to become reflectable in the common cases but also failing to predict when this doesn't expand results in scanning failures due to unmet reflection dependencies).

Give up on trying to predict when intrinsic expansion kicks in and instead lean into RVA statics not being expressible in C# and the fields not being reflection-invokable anyway.
src/coreclr/jit/importercalls.cpp
src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/UsageBasedMetadataManager.cs
src/coreclr/tools/aot/ILCompiler.Compiler/IL/ILImporter.Scanner.cs