TransformSpillsInterface

Trait TransformSpillsInterface 

Source
pub trait TransformSpillsInterface {
    // Required methods
    fn create_unconditional_branch(
        &self,
        builder: &mut OpBuilder,
        destination: BlockRef,
        arguments: &[ValueRef],
        span: SourceSpan,
    ) -> Result<(), Report>;
    fn create_spill(
        &self,
        builder: &mut OpBuilder,
        value: ValueRef,
        span: SourceSpan,
    ) -> Result<OperationRef, Report>;
    fn create_reload(
        &self,
        builder: &mut OpBuilder,
        value: ValueRef,
        span: SourceSpan,
    ) -> Result<OperationRef, Report>;
    fn convert_spill_to_store(
        &mut self,
        rewriter: &mut dyn Rewriter,
        spill: OperationRef,
    ) -> Result<(), Report>;
    fn convert_reload_to_load(
        &mut self,
        rewriter: &mut dyn Rewriter,
        reload: OperationRef,
    ) -> Result<(), Report>;
}
Expand description

This interface is used in conjunction with transform_spills so that the transform can be used with any dialect, and more importantly, avoids forming a dependency on our own dialects for the subset of operations we need to emit/rewrite.

Required Methods§

Source

fn create_unconditional_branch( &self, builder: &mut OpBuilder, destination: BlockRef, arguments: &[ValueRef], span: SourceSpan, ) -> Result<(), Report>

Create an unconditional branch to destination

Source

fn create_spill( &self, builder: &mut OpBuilder, value: ValueRef, span: SourceSpan, ) -> Result<OperationRef, Report>

Create a spill for value, returning the spill instruction

Source

fn create_reload( &self, builder: &mut OpBuilder, value: ValueRef, span: SourceSpan, ) -> Result<OperationRef, Report>

Create a reload of value, returning the reload instruction

Source

fn convert_spill_to_store( &mut self, rewriter: &mut dyn Rewriter, spill: OperationRef, ) -> Result<(), Report>

Convert spill, a SpillLike operation, into a primitive memory store of the spilled value.

Source

fn convert_reload_to_load( &mut self, rewriter: &mut dyn Rewriter, reload: OperationRef, ) -> Result<(), Report>

Convert reload, a ReloadLike operation, into a primitive memory load of the spilled value.

Implementors§