Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
[mini] Disable passing valuetypes in SIMD registers
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)
  • Loading branch information
lambdageek authored and github-actions committed Aug 25, 2022
commit cc773b851c1177f82de7ab667e6dcc35df231bcd
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