[interp] Kill more instructions (mono/mono#17226)
authorVlad Brezae <brezaevlad@gmail.com>
Thu, 10 Oct 2019 19:29:19 +0000 (22:29 +0300)
committerBernhard Urban-Forster <lewurm@gmail.com>
Thu, 10 Oct 2019 19:29:19 +0000 (21:29 +0200)
commit2b8a73a2036004d6c04659e7607f5773ab26d91a
tree047ca2985f1602dae8620d1c87a0095726ca8b6d
parent472c2bfadda9ce1f6b6373c4d579797eb642fcd7
[interp] Kill more instructions (mono/mono#17226)

* [interp] Replace STLOC to dead local with MINT_POP

* [interp] Optimize MINT_POP

It was only used for 0 and 1 values. The implementation for values larger than 1 was broken anyway.

* [interp] Remove unnecessary usage of MINT_POP1

When storing a static field from a CEE_STFLD instruction.

* [interp] Prevent optimizing away the stack, after a branch

We know the contents of the stack following a branch, so we could have optimized away some instructions preceding the branch. We shouldn't do this because the code we are branching to expects a certain stack size.

* [interp] Clear instructions which push unused values on stack

* [interp] Properly initialize stack when pushing local

Commit migrated from https://github.com/mono/mono/commit/165c114aaa68a52c5aa10ae1df93816f71061840
src/mono/mono/mini/interp/interp-internals.h
src/mono/mono/mini/interp/interp.c
src/mono/mono/mini/interp/mintops.def
src/mono/mono/mini/interp/mintops.h
src/mono/mono/mini/interp/transform.c