Beaver.MLIR.PostDominanceInfo (beaver v0.4.8)

Copy Markdown

High-level access to MLIR post-dominance analysis.

A post-dominance info owns native analysis state. It must not outlive the IR or context from which it was created, and must be destroyed with destroy/1. Prefer with_info/2 for scoped use. Call invalidate/1 after mutating the analyzed IR.

Summary

Functions

Creates an owned post-dominance analysis for an operation or module.

Destroys an owned post-dominance analysis.

Invalidates all cached post-dominance information and returns info.

Returns whether a post-dominates b.

Returns whether a properly post-dominates b (excluding equality).

Runs fun with a new post-dominance analysis and always destroys it.

Types

analyzed_ir()

@type analyzed_ir() :: Beaver.MLIR.Module.t() | Beaver.MLIR.Operation.t()

t()

@type t() :: %Beaver.MLIR.PostDominanceInfo{ref: term()}

Functions

create(ir)

@spec create(analyzed_ir()) :: t()

Creates an owned post-dominance analysis for an operation or module.

destroy(info)

@spec destroy(t()) :: :ok

Destroys an owned post-dominance analysis.

invalidate(info)

@spec invalidate(t()) :: t()

Invalidates all cached post-dominance information and returns info.

make(value)

post_dominates?(info, a, b)

@spec post_dominates?(t(), Beaver.MLIR.Operation.t(), Beaver.MLIR.Operation.t()) ::
  boolean()
@spec post_dominates?(t(), Beaver.MLIR.Block.t(), Beaver.MLIR.Block.t()) :: boolean()

Returns whether a post-dominates b.

properly_post_dominates?(info, a, b)

@spec properly_post_dominates?(
  t(),
  Beaver.MLIR.Operation.t(),
  Beaver.MLIR.Operation.t()
) :: boolean()
@spec properly_post_dominates?(t(), Beaver.MLIR.Block.t(), Beaver.MLIR.Block.t()) ::
  boolean()

Returns whether a properly post-dominates b (excluding equality).

with_info(ir, fun)

@spec with_info(analyzed_ir(), (t() -> result)) :: result when result: var

Runs fun with a new post-dominance analysis and always destroys it.