Skip to content

Commit

Permalink
[mini] Disable passing valuetypes in SIMD registers (#74592)
Browse files Browse the repository at this point in the history
Partially reverts #68991

When LLVM code calls non-LLVM code it will pass arguments in SIMD
registers which the non-LLVM code doesn't expect

Fixes #73454 (issue 1)

Co-authored-by: Aleksey Kliger <[email protected]>
  • Loading branch information
github-actions[bot] and lambdageek authored Aug 25, 2022
1 parent fbed739 commit df85dc1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/mono/mono/mini/mini-amd64.c
Original file line number Diff line number Diff line change
Expand Up @@ -2165,13 +2165,20 @@ mono_arch_get_llvm_call_info (MonoCompile *cfg, MonoMethodSignature *sig)
return linfo;
}

#if 0
/* FIXME: the non-LLVM codegen should also pass arguments in registers or
* else there could a mismatch when LLVM code calls non-LLVM code
*
* See https://github.com/dotnet/runtime/issues/73454
*/
if ((t->type == MONO_TYPE_GENERICINST) && !cfg->full_aot && !sig->pinvoke) {
MonoClass *klass = mono_class_from_mono_type_internal (t);
if (MONO_CLASS_IS_SIMD (cfg, klass)) {
linfo->args [i].storage = LLVMArgVtypeInSIMDReg;
break;
}
}
#endif

linfo->args [i].storage = LLVMArgVtypeInReg;
for (j = 0; j < 2; ++j)
Expand Down
7 changes: 7 additions & 0 deletions src/mono/mono/mini/mini-arm64.c
Original file line number Diff line number Diff line change
Expand Up @@ -2521,13 +2521,20 @@ mono_arch_get_llvm_call_info (MonoCompile *cfg, MonoMethodSignature *sig)
break;
}
case ArgVtypeInIRegs:
#if 0
/* FIXME: the non-LLVM codegen should also pass arguments in registers or
* else there could a mismatch when LLVM code calls non-LLVM code
*
* See https://github.com/dotnet/runtime/issues/73454
*/
if ((t->type == MONO_TYPE_GENERICINST) && !cfg->full_aot && !sig->pinvoke) {
MonoClass *klass = mono_class_from_mono_type_internal (t);
if (MONO_CLASS_IS_SIMD (cfg, klass)) {
lainfo->storage = LLVMArgVtypeInSIMDReg;
break;
}
}
#endif

lainfo->storage = LLVMArgAsIArgs;
lainfo->nslots = ainfo->nregs;
Expand Down

0 comments on commit df85dc1

Please sign in to comment.