Intermediate Representation

This should become a simplified semi-formal description of the cacao IR.

Method

The IR of a method consists of:

Basic Block

A basic block consists of:

Constraints on the instruction list (basic block properties):

Temporary variables Tj:

Constraints on variable references:

STACKVARs:

ARGVARs:

LOCALVARs:

Liveness:

Coalescing of IN and OUT variables (for SSA)

For SSA, whenever there is a non-exception edge from Block A to Block B:

for all i in {0, 1, ..., nout_A-1 (== nin_B-1)}:
    coalesce *OUTi_A with *INi_B

NOTE: It must be guaranteed that OUTi_A and INi_B (for each i), do not interfere with each other.

A problem can arise, for example, if there is a loop in the CFG that leads to two interfering variables to be (transitively) coalesced, because they appear in the IN/OUT references.

We must be careful to keep this property when we move away from the stack model.

Block Prolog (STD blocks)

For simplereg:

for i in {0, 1, ..., nin-1}:
        *INi <- Ii

Block Prolog (EXH blocks)

Block Prolog (SBR blocks)

Block Epilog

For simplereg:

for i in {0, 1, ..., nout-1}:
        Ii <- *OUTi

For SSA:

Phi-moves to the successor's in-variables. (Needs to be specified.)

Instruction

An instruction (ICMD) consists of:

Constraints:

NOTE: Only the DUP_* instructions need more than one destination.

cacaowiki: IntermediateRepresentation (last edited 2006-08-27 11:12:38 by EdwinSteiner)