Skip to content

[TM-262] Extend set of rules where DIP is redundant

Ivan Gromakovskii requested to merge gromak/tm262-another-rule into master

Description

Problem: our optimizer has noDipNeeded rule, but it does not consider some cases where DIP can be erased.

Solution: add two new rules:

  • UNIT followed by DIP, it is essentially the same as PUSH followed by DIP.
  • DIP followed by DROP.

Related issue(s)

https://issues.serokell.io/issue/TM-262

Checklist for your Merge Request

Related changes (conditional)

  • Tests (see short guidelines)

    • If I added new functionality, I added tests covering it.
    • If I fixed a bug, I added a regression test to prevent the bug from silently reappearing again.
  • Documentation

    • I checked whether I should update the docs and did so if necessary:

Stylistic guide (mandatory)

Merge request reports