Skip to content

Improve elimination for locally known cases #332

Open
@jasoncarr0

Description

@jasoncarr0

From examination of the IR in many, there are frequent cases where the inputs to a simple testing block are known, and the test could be skipped. Known case will handle some cases, but only when the block has no statements, and it has no support for numbers.

So we want some of the following:

  • Handle known numbers, and associated primitives, e.g. arithmetic and overflow
  • Allow the inclusion of statements which will be sufficiently simple once reduced for this case.

I think it would suffice to do the following: perform abstract interpretation for partial constants (finite sets of constructors, numbers), at each Goto or Case, passing through each statement, simplifying them for this case, until blocked or hitting an unknown case, then replacing the jump with the longest prefix of trivial (constants, constructors, moves, arithmetic, etc) statements which were passed over.

Termination checking (#331) would benefit such a change

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions