Skip to content
This repository was archived by the owner on Aug 2, 2019. It is now read-only.
This repository was archived by the owner on Aug 2, 2019. It is now read-only.

Pre-SSA form #44

@eliotmoss

Description

@eliotmoss

We have concluded that while the official form of Mu IR is SSA form (but see Issue #18 for current thoughts on how to represent that form), many clients will find it more convenient to generate something that is mostly Mu IR but that is not in SSA form, and that is it further desirable to offer a standard tool to convert from some "pre-SSA" form to proper SSA form. This tool may operate in a stand alone manner or be more in bed with an implementation of Mu.

We propose the following specific pre-SSA form, according to how it differs from SSA-form Mu.

  1. "SSA-variables" may be assigned more than once; however, any individual such variable must be used in a type-consistent manner.
  2. PHIs may be omitted (or, in the proposal of How to represent merging of variables / Phi functions #18, values may be omitted at branches and variables omitted at labels)
  3. For convenience we introduce a "copy" operator, var = ID arg, which takes one argument arg of type T and assigns it to variable var. This operator seems to be convenient sometimes from a client perspective.

The converter to SSA-form will perform live-ness analysis and add variables to labels and values to branches as necessary, checking for type consistency. If some variable is live but not initialized, then the converter will insert a safe initialization (to 0 or 0.0 for numeric types, null for a pointer, etc.) at the latest possible point that does not interfere with existing assignments to the variable. (Optimization may move the initialization earlier as deemed appropriate.)

We will undertake to develop the converter in Scala or Java.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions