Struct cretonne_codegen::ir::layout::Layout[][src]

pub struct Layout { /* fields omitted */ }

The Layout struct determines the layout of EBBs and instructions in a function. It does not contain definitions of instructions or EBBs, but depends on Inst and Ebb entity references being defined elsewhere.

This data structure determines:

  • The order of EBBs in the function.
  • Which EBB contains a given instruction.
  • The order of instructions with an EBB.

While data dependencies are not recorded, instruction ordering does affect control dependencies, so part of the semantics of the program are determined by the layout.

Methods

impl Layout
[src]

Create a new empty Layout.

Clear the layout.

impl Layout
[src]

Methods for laying out EBBs.

An unknown EBB starts out as not inserted in the EBB layout. The layout is a linear order of inserted EBBs. Once an EBB has been inserted in the layout, instructions can be added. An EBB can only be removed from the layout when it is empty.

Since every EBB must end with a terminator instruction which cannot fall through, the layout of EBBs do not affect the semantics of the program.

Is ebb currently part of the layout?

Insert ebb as the last EBB in the layout.

Insert ebb in the layout before the existing EBB before.

Insert ebb in the layout after the existing EBB after.

Remove ebb from the layout.

Important traits for Ebbs<'f>

Return an iterator over all EBBs in layout order.

Get the function's entry block. This is simply the first EBB in the layout order.

Get the last EBB in the layout.

Get the block preceding ebb in the layout order.

Get the block following ebb in the layout order.

impl Layout
[src]

Methods for arranging instructions.

An instruction starts out as not inserted in the layout. An instruction can be inserted into an EBB at a given position.

Get the EBB containing inst, or None if inst is not inserted in the layout.

Get the EBB containing the program point pp. Panic if pp is not in the layout.

Append inst to the end of ebb.

Fetch an ebb's first instruction.

Fetch an ebb's last instruction.

Fetch the instruction following inst.

Fetch the instruction preceding inst.

Insert inst before the instruction before in the same EBB.

Remove inst from the layout.

Important traits for Insts<'f>

Iterate over the instructions in ebb in layout order.

Split the EBB containing before in two.

Insert new_ebb after the old EBB and move before and the following instructions to new_ebb:

old_ebb:
    i1
    i2
    i3 << before
    i4

becomes:

old_ebb:
    i1
    i2
new_ebb:
    i3 << before
    i4

Trait Implementations

impl Clone for Layout
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl ProgramOrder for Layout
[src]

Compare the program points a and b relative to this program order. Read more

Is the range from inst to ebb just the gap between consecutive EBBs? Read more

impl<'f> IntoIterator for &'f Layout
[src]

Use a layout reference in a for loop.

The type of the elements being iterated over.

Which kind of iterator are we turning this into?

Important traits for Ebbs<'f>

Creates an iterator from a value. Read more

Auto Trait Implementations

impl Send for Layout

impl Sync for Layout