[interp] Emit more stloc.np (mono/mono#16796)
authorVlad Brezae <brezaevlad@gmail.com>
Thu, 12 Sep 2019 17:46:22 +0000 (20:46 +0300)
committerLarry Ewing <lewing@microsoft.com>
Thu, 12 Sep 2019 17:46:22 +0000 (12:46 -0500)
Use STLOC_NP_O also for MINT_TYPE_P. It has the same behavior.

Commit migrated from https://github.com/mono/mono/commit/72405f68af0d7684c3601d0d8b2c63b966022622

src/mono/mono/mini/interp/transform.c

index 52dd738..e036fb2 100644 (file)
@@ -6298,7 +6298,7 @@ interp_cprop (TransformData *td)
                                if (ins->opcode - MINT_LDLOC_I1 == mt) {
                                        if (mt == MINT_TYPE_I4)
                                                replace_op = MINT_STLOC_NP_I4;
-                                       else if (mt == MINT_TYPE_O)
+                                       else if (mt == MINT_TYPE_O || mt == MINT_TYPE_P)
                                                replace_op = MINT_STLOC_NP_O;
                                        if (replace_op) {
                                                if (td->verbose_level)
@@ -6306,6 +6306,7 @@ interp_cprop (TransformData *td)
                                                interp_clear_ins (td, ins->prev);
                                                ins->opcode = replace_op;
                                                mono_interp_stats.killed_instructions++;
+                                               // FIXME We know what local is on the stack now. Track it
                                        }
                                }
                        }