[#665] Apply dipDrop2swapDrop in a separate stage, and refactor how stages work
Description
Problem: dipDrop2swapDrop
rule blocks adjacentDIPs
.
Solution: First run main stage rules without dipDrop2swapDrop
, then
run them plus dipDrop2swapDrop
. dipDrop2swapDrop
can open up
opportunities for further optimization, hence it needs to be run with
other rules in tandem.
Problem: Currently, optimizer rules are represented as list of stages,
where each stage is constructed as orSimpleRule flattenSeqLHS ...
.
This makes the architecture not very pluggable.
Solution: Represent the ruleset as a newtype over IntMap (NonEmpty Rule)
. Add utilities for working with this type. When running the
rules, fold the NonEmpty
representing the stage using orSimpleRule
with flattenSeqLHS
as initial.
Related issue(s)
Resolves #
✅ 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
Stylistic guide (mandatory)
-
My commits comply with the following policy. -
My code complies with the style guide.