Skip to content

Commit ff5e097

Browse files
committed
Extend support for the "simd-but-not-exactly-simd" hack to OP_LDADDR
1 parent 31edf20 commit ff5e097

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

src/mono/mono/mini/mini-llvm.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6691,7 +6691,7 @@ process_bb (EmitContext *ctx, MonoBasicBlock *bb)
66916691
MonoInst *var = ins->inst_i0;
66926692
MonoClass *klass = var->klass;
66936693

6694-
if (var->opcode == OP_VTARG_ADDR && !MONO_CLASS_IS_SIMD(cfg, klass)) {
6694+
if (var->opcode == OP_VTARG_ADDR && !MONO_CLASS_IS_SIMD(cfg, klass) && !simd_class_to_llvm_type (ctx, klass)) {
66956695
/* The variable contains the vtype address */
66966696
values [ins->dreg] = values [var->dreg];
66976697
} else if (var->opcode == OP_GSHAREDVT_LOCAL) {
@@ -7306,12 +7306,14 @@ process_bb (EmitContext *ctx, MonoBasicBlock *bb)
73067306
dst = convert (ctx, LLVMBuildAdd (builder, convert (ctx, values [ins->inst_destbasereg], IntPtrType ()), LLVMConstInt (IntPtrType (), ins->inst_offset, FALSE), ""), LLVMPointerType (LLVMInt8Type (), 0));
73077307
}
73087308
break;
7309-
case OP_LOADV_MEMBASE:
7309+
case OP_LOADV_MEMBASE: {
73107310
if (!addresses [ins->dreg])
73117311
addresses [ins->dreg] = build_alloca (ctx, m_class_get_byval_arg (klass));
7312-
src = convert (ctx, LLVMBuildAdd (builder, convert (ctx, values [ins->inst_basereg], IntPtrType ()), LLVMConstInt (IntPtrType (), ins->inst_offset, FALSE), ""), LLVMPointerType (LLVMInt8Type (), 0));
7312+
LLVMValueRef base = convert (ctx, values [ins->inst_basereg], IntPtrType ());
7313+
src = convert (ctx, LLVMBuildAdd (builder, base, LLVMConstInt (IntPtrType (), ins->inst_offset, FALSE), ""), LLVMPointerType (LLVMInt8Type (), 0));
73137314
dst = LLVMBuildBitCast (builder, addresses [ins->dreg], LLVMPointerType (LLVMInt8Type (), 0), "");
73147315
break;
7316+
}
73157317
case OP_VMOVE:
73167318
if (!addresses [ins->sreg1])
73177319
addresses [ins->sreg1] = build_alloca (ctx, m_class_get_byval_arg (klass));

0 commit comments

Comments
 (0)