dotnet / runtime

.NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.
https://docs.microsoft.com/dotnet/core/
MIT License
14.97k stars 4.66k forks source link

crossgen2: getHFAType fails on arm64 and passes on x64 targetting arm64 #46126

Open sandreenko opened 3 years ago

sandreenko commented 3 years ago

https://github.com/dotnet/runtime/blob/78efb9250245617ff8532371ae4b8375a741f5ea/src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs#L2540 fails on arm64 and passes on x64 targetting arm64.

To repro get this change: https://github.com/sandreenko/runtime/commit/880a563af8171609257c80045538d98401aa8877

readytorun\crossgen2\crossgen2smoke

and run crossgen2 test on x64 -> passes, on x64 targeting arm64 -> passes, on arm64 -> fails with:

Z:\PayloadGroup0>dotnet "Z:\CoreRoot\crossgen2\crossgen2.dll" @"Z:\PayloadGroup0\readytorun\crossgen2\crossgen2smoke\\composite-r2r.dll.rsp"   --composite"
To repro, add following arguments to the command line:
--singlemethodtypename "HelperGenericILCode`1[[System.__Canon]],helperildll" --singlemethodname LdTokenArrayMethods --singlemethodindex 1
Unhandled exception. ILCompiler.CodeGenerationFailedException: Code generation failed for method '[helperildll]HelperGenericILCode`1<System.__Canon>.LdTokenArrayMethods(RuntimeMethodHandle&,RuntimeMethodHandle&,RuntimeMethodHandle&,RuntimeMethodHandle&,RuntimeMethodHandle&)'
   at Internal.JitInterface.CorInfoImpl.CompileMethodInternal(IMethodNode methodCodeNodeNeedingCode, MethodIL methodIL) in /_/src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs:line 216
   at Internal.JitInterface.CorInfoImpl.CompileMethod(MethodWithGCInfo methodCodeNodeNeedingCode) in /_/src/coreclr/tools/aot/ILCompiler.ReadyToRun/JitInterface/CorInfoImpl.ReadyToRun.cs:line 391
   at ILCompiler.ReadyToRunCodegenCompilation.<ComputeDependencyNodeDependencies>b__26_0(DependencyNodeCore`1 dependency) in /_/src/coreclr/tools/aot/ILCompiler.ReadyToRun/Compiler/ReadyToRunCodegenCompilation.cs:line 499
   at ILCompiler.ReadyToRunCodegenCompilation.ComputeDependencyNodeDependencies(List`1 obj) in /_/src/coreclr/tools/aot/ILCompiler.ReadyToRun/Compiler/ReadyToRunCodegenCompilation.cs:line 525
   at ILCompiler.DependencyAnalysisFramework.DependencyAnalyzer`2.ComputeMarkedNodes() in /_/src/coreclr/tools/aot/ILCompiler.DependencyAnalysisFramework/DependencyAnalyzer.cs:line 302
   at ILCompiler.ReadyToRunCodegenCompilation.Compile(String outputFile) in /_/src/coreclr/tools/aot/ILCompiler.ReadyToRun/Compiler/ReadyToRunCodegenCompilation.cs:line 302
   at ILCompiler.Program.Run(String[] args) in /_/src/coreclr/tools/aot/crossgen2/Program.cs:line 590
   at ILCompiler.Program.Main(String[] args) in /_/src/coreclr/tools/aot/crossgen2/Program.cs:line 739

for the minimal repro use the following rsp file(with your passes):

Y:\PayloadGroup0\readytorun\crossgen2\crossgen2smoke\IL-CG2\*.dll
-o:Y:\PayloadGroup0\readytorun\crossgen2\crossgen2smoke\\composite-r2r.dll
--targetarch:arm64
--verify-type-and-field-layout
-O
-r:Y:\CoreRoot\System.*.dll
-r:Y:\CoreRoot\Microsoft.*.dll
-r:Y:\CoreRoot\mscorlib.dll
-r:Y:\CoreRoot\netstandard.dll
--parallelism 
1
--singlemethodtypename 
HelperGenericILCode`1[[System.__Canon]],helperildll
--singlemethodname
LdTokenArrayMethods
--singlemethodindex
1

Remove a workaround for https://github.com/dotnet/runtime/pull/46034 when it is fixed.

sandreenko commented 3 years ago

PTAL @mangod9 @jkotas

mangod9 commented 3 years ago

cc @dotnet/crossgen-contrib. @sandreenko, is this blocking your PR from merging?

sandreenko commented 3 years ago

@mangod9 no, it does not

mangod9 commented 3 years ago

Thanks, assigning to @AntonLapounov who will look at it in Jan.

mangod9 commented 3 years ago

assume this is still something that needs investigation?

AntonLapounov commented 3 years ago

We discussed that offline. The current behavior may be considered "by design". There was another question why compiling for ARM64 on x64 and ARM64 machines demonstrated different behavior (no assert vs. assert). I can check whether it is still the case. I think we can safely move it to future release.

ivdiazsa commented 1 year ago

This issue is apparently still happening. I'm currently investigating.

ivdiazsa commented 1 year ago

Ok so I'm seeing an interesting and more pattern-like behavior now. This is now failing with a slightly different error message, but in a more uniform way. If we target x64 using an x64 host, it all goes fine. However, targeting arm64 always fails, regardless of whether the host is x64 or arm64. This is the error message I'm seeing:

Unhandled exception.Unhandled exception. Unhandled exception.Unhandled exception.   ILCompiler.CodeGenerationFailedException: Code generation failed for method '[S.P.CoreLib]System.Array.CreateInstance(Type,int64[])'
 ---> System.InvalidCastException: Unable to cast object of type 'Internal.TypeSystem.ArrayType' to type 'Internal.TypeSystem.DefType'.
   at Internal.JitInterface.CorInfoImpl.getHFAType(CORINFO_CLASS_STRUCT_* hClass) in /media/ivdiazsa/DataDrive/Development/dotnet_runtime-x64-and-arm64/src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs:line 3030
   at Internal.JitInterface.CorInfoImpl._getHFAType(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* hClass) in /media/ivdiazsa/DataDrive/Development/dotnet_runtime-x64-and-arm64/src/coreclr/tools/Common/JitInterface/CorInfoImpl_generated.cs:line 1691
   --- End of inner exception stack trace ---
   at Internal.JitInterface.CorInfoImpl.CompileMethodInternal(IMethodNode methodCodeNodeNeedingCode, MethodIL methodIL) in /media/ivdiazsa/DataDrive/Development/dotnet_runtime-x64-and-arm64/src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs:line 380
   at Internal.JitInterface.CorInfoImpl.CompileMethod(MethodWithGCInfo methodCodeNodeNeedingCode, Logger logger) in /media/ivdiazsa/DataDrive/Development/dotnet_runtime-x64-and-arm64/src/coreclr/tools/aot/ILCompiler.ReadyToRun/JitInterface/CorInfoImpl.ReadyToRun.cs:line 736
   at ILCompiler.ReadyToRunCodegenCompilation.<>c__DisplayClass46_0.<ComputeDependencyNodeDependencies>g__CompileOneMethod|5(DependencyNodeCore`1 dependency, Int32 compileThreadId) in /media/ivdiazsa/DataDrive/Development/dotnet_runtime-x64-and-arm64/src/coreclr/tools/aot/ILCompiler.ReadyToRun/Compiler/ReadyToRunCodegenCompilation.cs:line 841
   at ILCompiler.ReadyToRunCodegenCompilation.<>c__DisplayClass46_0.<ComputeDependencyNodeDependencies>g__CompileOnThread|4(Int32 compilationThreadId) in /media/ivdiazsa/DataDrive/Development/dotnet_runtime-x64-and-arm64/src/coreclr/tools/aot/ILCompiler.ReadyToRun/Compiler/ReadyToRunCodegenCompilation.cs:line 775
   at ILCompiler.ReadyToRunCodegenCompilation.<>c__DisplayClass46_0.<ComputeDependencyNodeDependencies>g__CompilationThread|3(Object objThreadId) in /media/ivdiazsa/DataDrive/Development/dotnet_runtime-x64-and-arm64/src/coreclr/tools/aot/ILCompiler.ReadyToRun/Compiler/ReadyToRunCodegenCompilation.cs:line 753ILCompiler.CodeGenerationFailedException: Code generation failed for method '[S.P.CoreLib]System.Array.CreateInstance(Type,int32[])'
 ---> System.InvalidCastException: Unable to cast object of type 'Internal.TypeSystem.ArrayType' to type 'Internal.TypeSystem.DefType'.
   at Internal.JitInterface.CorInfoImpl.getHFAType(CORINFO_CLASS_STRUCT_* hClass) in /media/ivdiazsa/DataDrive/Development/dotnet_runtime-x64-and-arm64/src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs:line 3030
   at Internal.JitInterface.CorInfoImpl._getHFAType(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* hClass) in /media/ivdiazsa/DataDrive/Development/dotnet_runtime-x64-and-arm64/src/coreclr/tools/Common/JitInterface/CorInfoImpl_generated.cs:line 1691
   --- End of inner exception stack trace ---
   at Internal.JitInterface.CorInfoImpl.CompileMethodInternal(IMethodNode methodCodeNodeNeedingCode, MethodIL methodIL) in /media/ivdiazsa/DataDrive/Development/dotnet_runtime-x64-and-arm64/src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs:line 380
   at Internal.JitInterface.CorInfoImpl.CompileMethod(MethodWithGCInfo methodCodeNodeNeedingCode, Logger logger) in /media/ivdiazsa/DataDrive/Development/dotnet_runtime-x64-and-arm64/src/coreclr/tools/aot/ILCompiler.ReadyToRun/JitInterface/CorInfoImpl.ReadyToRun.cs:line 736
   at ILCompiler.ReadyToRunCodegenCompilation.<>c__DisplayClass46_0.<ComputeDependencyNodeDependencies>g__CompileOneMethod|5(DependencyNodeCore`1 dependency, Int32 compileThreadId) in /media/ivdiazsa/DataDrive/Development/dotnet_runtime-x64-and-arm64/src/coreclr/tools/aot/ILCompiler.ReadyToRun/Compiler/ReadyToRunCodegenCompilation.cs:line 841
   at ILCompiler.ReadyToRunCodegenCompilation.<>c__DisplayClass46_0.<ComputeDependencyNodeDependencies>g__CompileOnThread|4(Int32 compilationThreadId) in /media/ivdiazsa/DataDrive/Development/dotnet_runtime-x64-and-arm64/src/coreclr/tools/aot/ILCompiler.ReadyToRun/Compiler/ReadyToRunCodegenCompilation.cs:line 775
   at ILCompiler.ReadyToRunCodegenCompilation.<>c__DisplayClass46_0.<ComputeDependencyNodeDependencies>g__CompilationThread|3(Object objThreadId) in /media/ivdiazsa/DataDrive/Development/dotnet_runtime-x64-and-arm64/src/coreclr/tools/aot/ILCompiler.ReadyToRun/Compiler/ReadyToRunCodegenCompilation.cs:line 753ILCompiler.CodeGenerationFailedException: Code generation failed for method '[S.P.CoreLib]System.Array.GetValue(int32[])'
 ---> System.InvalidCastException: Unable to cast object of type 'Internal.TypeSystem.ArrayType' to type 'Internal.TypeSystem.DefType'.
   at Internal.JitInterface.CorInfoImpl.getHFAType(CORINFO_CLASS_STRUCT_* hClass) in /media/ivdiazsa/DataDrive/Development/dotnet_runtime-x64-and-arm64/src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs:line 3030
   at Internal.JitInterface.CorInfoImpl._getHFAType(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* hClass) in /media/ivdiazsa/DataDrive/Development/dotnet_runtime-x64-and-arm64/src/coreclr/tools/Common/JitInterface/CorInfoImpl_generated.cs:line 1691
   --- End of inner exception stack trace ---
   at Internal.JitInterface.CorInfoImpl.CompileMethodInternal(IMethodNode methodCodeNodeNeedingCode, MethodIL methodIL) in /media/ivdiazsa/DataDrive/Development/dotnet_runtime-x64-and-arm64/src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs:line 380
   at Internal.JitInterface.CorInfoImpl.CompileMethod(MethodWithGCInfo methodCodeNodeNeedingCode, Logger logger) in /media/ivdiazsa/DataDrive/Development/dotnet_runtime-x64-and-arm64/src/coreclr/tools/aot/ILCompiler.ReadyToRun/JitInterface/CorInfoImpl.ReadyToRun.cs:line 736
   at ILCompiler.ReadyToRunCodegenCompilation.<>c__DisplayClass46_0.<ComputeDependencyNodeDependencies>g__CompileOneMethod|5(DependencyNodeCore`1 dependency, Int32 compileThreadId) in /media/ivdiazsa/DataDrive/Development/dotnet_runtime-x64-and-arm64/src/coreclr/tools/aot/ILCompiler.ReadyToRun/Compiler/ReadyToRunCodegenCompilation.cs:line 841
   at ILCompiler.ReadyToRunCodegenCompilation.<>c__DisplayClass46_0.<ComputeDependencyNodeDependencies>g__CompileOnThread|4(Int32 compilationThreadId) in /media/ivdiazsa/DataDrive/Development/dotnet_runtime-x64-and-arm64/src/coreclr/tools/aot/ILCompiler.ReadyToRun/Compiler/ReadyToRunCodegenCompilation.cs:line 775
   at ILCompiler.ReadyToRunCodegenCompilation.<>c__DisplayClass46_0.<ComputeDependencyNodeDependencies>g__CompilationThread|3(Object objThreadId) in /media/ivdiazsa/DataDrive/Development/dotnet_runtime-x64-and-arm64/src/coreclr/tools/aot/ILCompiler.ReadyToRun/Compiler/ReadyToRunCodegenCompilation.cs:line 753ILCompiler.CodeGenerationFailedException: Code generation failed for method '[S.P.CoreLib]System.Array.CreateInstance(Type,int32[],int32[])'
 ---> System.InvalidCastException: Unable to cast object of type 'Internal.TypeSystem.ArrayType' to type 'Internal.TypeSystem.DefType'.
   at Internal.JitInterface.CorInfoImpl.getHFAType(CORINFO_CLASS_STRUCT_* hClass) in /media/ivdiazsa/DataDrive/Development/dotnet_runtime-x64-and-arm64/src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs:line 3030
   at Internal.JitInterface.CorInfoImpl._getHFAType(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* hClass) in /media/ivdiazsa/DataDrive/Development/dotnet_runtime-x64-and-arm64/src/coreclr/tools/Common/JitInterface/CorInfoImpl_generated.cs:line 1691
   --- End of inner exception stack trace ---
   at Internal.JitInterface.CorInfoImpl.CompileMethodInternal(IMethodNode methodCodeNodeNeedingCode, MethodIL methodIL) in /media/ivdiazsa/DataDrive/Development/dotnet_runtime-x64-and-arm64/src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs:line 380
   at Internal.JitInterface.CorInfoImpl.CompileMethod(MethodWithGCInfo methodCodeNodeNeedingCode, Logger logger) in /media/ivdiazsa/DataDrive/Development/dotnet_runtime-x64-and-arm64/src/coreclr/tools/aot/ILCompiler.ReadyToRun/JitInterface/CorInfoImpl.ReadyToRun.cs:line 736
   at ILCompiler.ReadyToRunCodegenCompilation.<>c__DisplayClass46_0.<ComputeDependencyNodeDependencies>g__CompileOneMethod|5(DependencyNodeCore`1 dependency, Int32 compileThreadId) in /media/ivdiazsa/DataDrive/Development/dotnet_runtime-x64-and-arm64/src/coreclr/tools/aot/ILCompiler.ReadyToRun/Compiler/ReadyToRunCodegenCompilation.cs:line 841
   at ILCompiler.ReadyToRunCodegenCompilation.<>c__DisplayClass46_0.<ComputeDependencyNodeDependencies>g__CompileOnThread|4(Int32 compilationThreadId) in /media/ivdiazsa/DataDrive/Development/dotnet_runtime-x64-and-arm64/src/coreclr/tools/aot/ILCompiler.ReadyToRun/Compiler/ReadyToRunCodegenCompilation.cs:line 775
   at ILCompiler.ReadyToRunCodegenCompilation.<>c__DisplayClass46_0.<ComputeDependencyNodeDependencies>g__CompilationThread|3(Object objThreadId) in /media/ivdiazsa/DataDrive/Development/dotnet_runtime-x64-and-arm64/src/coreclr/tools/aot/ILCompiler.ReadyToRun/Compiler/ReadyToRunCodegenCompilation.cs:line 753

Does this mean we should treat it by design as Anton previously mentioned, or does this mean we now got a more severe bug in our hands? I'd like to hear your thoughts on how we should treat it @trylek @mangod9

jkotas commented 1 year ago

The comment on getHFAType JIT/EE interface method says: Returns type of HFA for valuetype

The crossgen implementation of this method assumes that this method can be only called on valuetypes. https://github.com/sandreenko/runtime/commit/880a563af8171609257c80045538d98401aa8877 violates the assumption and that's why you are seeing the crash.

We can either:

ivdiazsa commented 1 year ago

The comment on getHFAType JIT/EE interface method says: Returns type of HFA for valuetype

The crossgen implementation of this method assumes that this method can be only called on valuetypes. sandreenko@880a563 violates the assumption and that's why you are seeing the crash.

We can either:

  • Change the method contract to make it callable on any type: Adjust the comment, adjust the crossgen implementation (return false), apply the proposed change in the JIT. or
  • Keep the method contract as is (ie treat the current behavior as "by design"). It would be nice to add assert to vm/jitinterface.cpp to ensure that this method is only called for valuetypes, so that we are not seeing these problems in crossgen and AOT only.

Thanks for the detailed explanation Jan. After discussing with Tomas, we think your second suggestion is the more reasonable way to solve this problem. I just wanted to ask something that is not clear to me. By adding an assert, then this means we will always crash with the given repro, regardless of architecture correct?

trylek commented 1 year ago

@ivdiazsa - I think that part of the trick is fixing Sergey's JIT change to only call the JIT interface method for valuetypes; the assert in jitinterface.cpp will just make sure that we crash once someone violates it in JIT again in the future.

sandreenko commented 1 year ago

The assert and change in Jit to call it only on value types sound reasonable. Probably many methods in jit call it right now without a value type check, like https://github.com/dotnet/runtime/blob/652433bfe9858f7f4d6f6ffcf0c994cb9b91e482/src/coreclr/jit/codegencommon.cpp#L6482 and expect that GetHfaType(NO_CLASS_HANDLE) returns TYP_UNDEF but the fix should not be complex.

trylek commented 1 year ago

I guess it should suffice to fix the JIT wrapper GetHfaType to avoid actually calling the JIT interface unless the type is a valuetype, there are various sorts of upfront checks there already.

jkotas commented 1 year ago

I guess it should suffice to fix the JIT wrapper GetHfaType to avoid actually calling the JIT interface unless the type is a valuetype

If you need to do another call on JIT/EE inteface to check whether it is a value type, it is more efficient to allow passing any types into the JIT/EE interface getHFAType API.

trylek commented 1 year ago

Hmm, I thought this information was readily available to JIT without making another interface call, if not, you're certainly right, we don't want to add another interface call for this purpose.

sandreenko commented 1 year ago

Hmm, I thought this information was readily available to JIT without making another interface call, if not, you're certainly right, we don't want to add another interface call for this purpose.

'isValueType' is saved in LclVars and GenTrees that call 'getHFAType' method so it is cheap to fix. Maybe it would ever be a speed-up not to call it when JIT-EE already knows the result.

cc @jakobbotsch

jakobbotsch commented 1 year ago

Some callers of GetHfaType already guard on varTypeIsStruct(type) for the corresponding JIT type, so it would make sense to me to do this more thoroughly. Alternatively we can change GetHfaType to take ClassLayout* that indeed already has cached isValueType available. That might also save a getClassSize JIT-EE call in a few places.

ghost commented 1 year ago

Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch See info in area-owners.md if you want to be subscribed.

Issue Details
https://github.com/dotnet/runtime/blob/78efb9250245617ff8532371ae4b8375a741f5ea/src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs#L2540 fails on arm64 and passes on x64 targetting arm64. To repro get this change: https://github.com/sandreenko/runtime/commit/880a563af8171609257c80045538d98401aa8877 ``` readytorun\crossgen2\crossgen2smoke ``` and run crossgen2 test on x64 -> passes, on x64 targeting arm64 -> passes, on arm64 -> fails with: ``` Z:\PayloadGroup0>dotnet "Z:\CoreRoot\crossgen2\crossgen2.dll" @"Z:\PayloadGroup0\readytorun\crossgen2\crossgen2smoke\\composite-r2r.dll.rsp" --composite" To repro, add following arguments to the command line: --singlemethodtypename "HelperGenericILCode`1[[System.__Canon]],helperildll" --singlemethodname LdTokenArrayMethods --singlemethodindex 1 Unhandled exception. ILCompiler.CodeGenerationFailedException: Code generation failed for method '[helperildll]HelperGenericILCode`1.LdTokenArrayMethods(RuntimeMethodHandle&,RuntimeMethodHandle&,RuntimeMethodHandle&,RuntimeMethodHandle&,RuntimeMethodHandle&)' at Internal.JitInterface.CorInfoImpl.CompileMethodInternal(IMethodNode methodCodeNodeNeedingCode, MethodIL methodIL) in /_/src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs:line 216 at Internal.JitInterface.CorInfoImpl.CompileMethod(MethodWithGCInfo methodCodeNodeNeedingCode) in /_/src/coreclr/tools/aot/ILCompiler.ReadyToRun/JitInterface/CorInfoImpl.ReadyToRun.cs:line 391 at ILCompiler.ReadyToRunCodegenCompilation.b__26_0(DependencyNodeCore`1 dependency) in /_/src/coreclr/tools/aot/ILCompiler.ReadyToRun/Compiler/ReadyToRunCodegenCompilation.cs:line 499 at ILCompiler.ReadyToRunCodegenCompilation.ComputeDependencyNodeDependencies(List`1 obj) in /_/src/coreclr/tools/aot/ILCompiler.ReadyToRun/Compiler/ReadyToRunCodegenCompilation.cs:line 525 at ILCompiler.DependencyAnalysisFramework.DependencyAnalyzer`2.ComputeMarkedNodes() in /_/src/coreclr/tools/aot/ILCompiler.DependencyAnalysisFramework/DependencyAnalyzer.cs:line 302 at ILCompiler.ReadyToRunCodegenCompilation.Compile(String outputFile) in /_/src/coreclr/tools/aot/ILCompiler.ReadyToRun/Compiler/ReadyToRunCodegenCompilation.cs:line 302 at ILCompiler.Program.Run(String[] args) in /_/src/coreclr/tools/aot/crossgen2/Program.cs:line 590 at ILCompiler.Program.Main(String[] args) in /_/src/coreclr/tools/aot/crossgen2/Program.cs:line 739 ``` for the minimal repro use the following rsp file(with your passes): ``` Y:\PayloadGroup0\readytorun\crossgen2\crossgen2smoke\IL-CG2\*.dll -o:Y:\PayloadGroup0\readytorun\crossgen2\crossgen2smoke\\composite-r2r.dll --targetarch:arm64 --verify-type-and-field-layout -O -r:Y:\CoreRoot\System.*.dll -r:Y:\CoreRoot\Microsoft.*.dll -r:Y:\CoreRoot\mscorlib.dll -r:Y:\CoreRoot\netstandard.dll --parallelism 1 --singlemethodtypename HelperGenericILCode`1[[System.__Canon]],helperildll --singlemethodname LdTokenArrayMethods --singlemethodindex 1 ``` Remove a workaround for https://github.com/dotnet/runtime/pull/46034 when it is fixed.
Author: sandreenko
Assignees: AntonLapounov
Labels: `arch-arm64`, `area-CodeGen-coreclr`
Milestone: Future
jakobbotsch commented 1 year ago

From a quick pass over the callers I think it will suffice to add a varTypeIsStruct(argSigType) guard here: https://github.com/dotnet/runtime/blob/3fded0bb77c852b10d712bd629ced740499a3aa6/src/coreclr/jit/morph.cpp#L2235

All other callers I saw seem to be from paths that already know we are dealing with a value type.