[interp] Constant folding for integers (mono/mono#17362)
authorVlad Brezae <brezaevlad@gmail.com>
Thu, 17 Oct 2019 11:23:12 +0000 (14:23 +0300)
committerGitHub <noreply@github.com>
Thu, 17 Oct 2019 11:23:12 +0000 (14:23 +0300)
commit8ef892ca479f5f9d4a1385fcafed3928aa9cdca7
tree420dc630109fefb0214a7845f7dbc3d9f1aa69e7
parent18ef47001befbd3dfe92187aeea109aea095275c
[interp] Constant folding for integers (mono/mono#17362)

* [interp] Move instructions together

For easy check if an instruction is unary or binary operation. We consider conversion instructions to be unary operators and compare instructions to be binary operators.

* [interp] Add stloc.np also for longs

* [interp] Add stats for total number of emitted instructions

Also make the killed_instructions counter actually track the total amount of killed instructions. It was not previously tracking instructions killed as part of addition of stloc.np / movloc.

* [interp] Improve logging during cprop

Make dumping instruction support also InterpInst's not just compacted instructions.

* [interp] Constant folding of common unary operators

* [interp] Constant fold binary operations

* [interp] Remove MINT_CONV_U8_I4 opcode

It is equivalent with MINT_CONV_I8_U4.

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