Skip to content

Remove some simple cases of unreachable code #10

Description

@elektito

In the absence of a complete graph analysis, we can still remove some simple cases like:

  • Anything from a "ret" instruction until next "_label"
  • Anything from a "jmp" instruction until next "_label"

One example of the first case being created by the compiler, is at the end of an if block, right before an "else" or an "elseif", if there is an "EXIT SUB/FUNCTION" statement. The compiler generates a JMP instruction afterwards to the end of the IF block, which is unreachable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    code-optimizerIssues related to CodeGen optimizer

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions