Beaver. MLIR. DominanceInfo
(beaver v0.4.8)
Copy Markdown
High-level access to MLIR dominance analysis.
A 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 when the analysis does not need to escape a scope.
Mutating the analyzed IR may make cached answers stale. Call invalidate/1
after a mutation before issuing another query.
Summary
Functions
Creates an owned dominance analysis for an operation or module.
Destroys an owned dominance analysis.
Returns whether a dominates b.
Invalidates all cached dominance information and returns info.
Returns the nearest common dominator, or nil when none exists.
Returns whether a properly dominates b (excluding equality).
Returns whether a block is reachable from the entry block of its region.
Returns whether a value dominates an operation.
Returns whether a value properly dominates an operation.
Runs fun with a new dominance analysis and always destroys it.
Types
@type analyzed_ir() :: Beaver.MLIR.Module.t() | Beaver.MLIR.Operation.t()
@type t() :: %Beaver.MLIR.DominanceInfo{ref: term()}
Functions
@spec create(analyzed_ir()) :: t()
Creates an owned dominance analysis for an operation or module.
@spec destroy(t()) :: :ok
Destroys an owned dominance analysis.
@spec dominates?(t(), Beaver.MLIR.Operation.t(), Beaver.MLIR.Operation.t()) :: boolean()
@spec dominates?(t(), Beaver.MLIR.Block.t(), Beaver.MLIR.Block.t()) :: boolean()
Returns whether a dominates b.
Invalidates all cached dominance information and returns info.
@spec nearest_common_dominator(t(), Beaver.MLIR.Block.t(), Beaver.MLIR.Block.t()) :: Beaver.MLIR.Block.t() | nil
Returns the nearest common dominator, or nil when none exists.
@spec properly_dominates?(t(), Beaver.MLIR.Operation.t(), Beaver.MLIR.Operation.t()) :: boolean()
@spec properly_dominates?(t(), Beaver.MLIR.Block.t(), Beaver.MLIR.Block.t()) :: boolean()
Returns whether a properly dominates b (excluding equality).
@spec reachable_from_entry?(t(), Beaver.MLIR.Block.t()) :: boolean()
Returns whether a block is reachable from the entry block of its region.
@spec value_dominates?(t(), Beaver.MLIR.Value.t(), Beaver.MLIR.Operation.t()) :: boolean()
Returns whether a value dominates an operation.
@spec value_properly_dominates?(t(), Beaver.MLIR.Value.t(), Beaver.MLIR.Operation.t()) :: boolean()
Returns whether a value properly dominates an operation.
@spec with_info(analyzed_ir(), (t() -> result)) :: result when result: var
Runs fun with a new dominance analysis and always destroys it.