Skip to content

Commit d44bc24

Browse files
authored
[mono][llvm] Fix an llvm assertion. (#97276)
Fixes #97217.
1 parent af969a3 commit d44bc24

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/mono/mono/mini/simd-intrinsics.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1712,6 +1712,18 @@ emit_sri_vector (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSignature *fsi
17121712
if (!COMPILE_LLVM (cfg))
17131713
return NULL;
17141714
#endif
1715+
if (COMPILE_LLVM (cfg)) {
1716+
/*
1717+
* The sregs are half size, and the dreg is full size
1718+
* which can cause problems if mono_handle_global_vregs () is trying to
1719+
* spill them since it uses ins->klass to create the variable.
1720+
* So create variables for them here.
1721+
* This is not a problem for the JIT since that only has 1 simd type right now.
1722+
*/
1723+
mono_compile_create_var_for_vreg (cfg, fsig->params [0], OP_LOCAL, args [0]->dreg);
1724+
mono_compile_create_var_for_vreg (cfg, fsig->params [1], OP_LOCAL, args [1]->dreg);
1725+
}
1726+
17151727
return emit_simd_ins (cfg, klass, OP_XCONCAT, args [0]->dreg, args [1]->dreg);
17161728
}
17171729
else if (is_elementwise_create_overload (fsig, etype))

0 commit comments

Comments
 (0)