Skip to content

Commit df85dc1

Browse files
[mini] Disable passing valuetypes in SIMD registers (#74592)
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 <alklig@microsoft.com>
1 parent fbed739 commit df85dc1

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

src/mono/mono/mini/mini-amd64.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2165,13 +2165,20 @@ mono_arch_get_llvm_call_info (MonoCompile *cfg, MonoMethodSignature *sig)
21652165
return linfo;
21662166
}
21672167

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

21762183
linfo->args [i].storage = LLVMArgVtypeInReg;
21772184
for (j = 0; j < 2; ++j)

src/mono/mono/mini/mini-arm64.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2521,13 +2521,20 @@ mono_arch_get_llvm_call_info (MonoCompile *cfg, MonoMethodSignature *sig)
25212521
break;
25222522
}
25232523
case ArgVtypeInIRegs:
2524+
#if 0
2525+
/* FIXME: the non-LLVM codegen should also pass arguments in registers or
2526+
* else there could a mismatch when LLVM code calls non-LLVM code
2527+
*
2528+
* See https://github.com/dotnet/runtime/issues/73454
2529+
*/
25242530
if ((t->type == MONO_TYPE_GENERICINST) && !cfg->full_aot && !sig->pinvoke) {
25252531
MonoClass *klass = mono_class_from_mono_type_internal (t);
25262532
if (MONO_CLASS_IS_SIMD (cfg, klass)) {
25272533
lainfo->storage = LLVMArgVtypeInSIMDReg;
25282534
break;
25292535
}
25302536
}
2537+
#endif
25312538

25322539
lainfo->storage = LLVMArgAsIArgs;
25332540
lainfo->nslots = ainfo->nregs;

0 commit comments

Comments
 (0)