Account for rank 1 array special casing in RyuJIT (#86312)
authorMichal Strehovský <MichalStrehovsky@users.noreply.github.com>
Tue, 16 May 2023 17:30:50 +0000 (02:30 +0900)
committerGitHub <noreply@github.com>
Tue, 16 May 2023 17:30:50 +0000 (10:30 -0700)
Should have been done in #84205.

src/coreclr/tools/aot/ILCompiler.Compiler/IL/ILImporter.Scanner.cs

index fc8a429..9e00383 100644 (file)
@@ -308,7 +308,10 @@ namespace Internal.IL
                     {
                         // RyuJIT is going to call the "MdArray" creation helper even if this is an SzArray,
                         // hence the IsArray check above. Note that the MdArray helper can handle SzArrays.
-                        _dependencies.Add(GetHelperEntrypoint(ReadyToRunHelper.NewMultiDimArr), reason);
+                        if (((ArrayType)owningType).Rank == 1)
+                            _dependencies.Add(GetHelperEntrypoint(ReadyToRunHelper.NewMultiDimArrRare), reason);
+                        else
+                            _dependencies.Add(GetHelperEntrypoint(ReadyToRunHelper.NewMultiDimArr), reason);
                         return;
                     }
                     else