[llvm] Avoid decomposing OP_STOREV_MEMBASE early for types which contains no referenc...
authorZoltan Varga <vargaz@gmail.com>
Thu, 5 Dec 2019 15:02:43 +0000 (16:02 +0100)
committerGitHub <noreply@github.com>
Thu, 5 Dec 2019 15:02:43 +0000 (16:02 +0100)
Commit migrated from https://github.com/mono/mono/commit/e67673fac85d13882256893d1b61c08ca0fc13c6

src/mono/mono/mini/decompose.c

index 8df6634..a448e21 100644 (file)
@@ -1273,7 +1273,9 @@ mono_decompose_vtype_opts (MonoCompile *cfg)
                                case OP_STOREV_MEMBASE: {
                                        src_var = get_vreg_to_inst (cfg, ins->sreg1);
 
-                                       if (COMPILE_LLVM (cfg) && !mini_is_gsharedvt_klass (ins->klass) && !cfg->gen_write_barriers)
+                                       mono_class_init_sizes (ins->klass);
+
+                                       if (COMPILE_LLVM (cfg) && !mini_is_gsharedvt_klass (ins->klass) && !(cfg->gen_write_barriers && m_class_has_references (ins->klass)))
                                                break;
 
                                        if (!src_var) {