scopeΒΆ

Scope configuration for a pass.

A PassScope defines the parts of a HUGR that a pass should be applied to, and which parts is it allowed to modify. Each variant defines three properties: root, preserve_interface and recursive.

From these, regions and in_scope can be derived.

A pass will always optimize the entrypoint region, unless the entrypoint is the module root.

Classes

ABCEnumMeta

Custom metaclass for things that inherit from both ABC and Enum.

GlobalScope

Run the pass on the whole Hugr, regardless of the entrypoint.

InScope

Whether a pass may modify a particular node.

LocalScope

A PassScope that means the pass should modify the hugr only beneath the entrypoint, unless the entrypoint is the module root, in which case the pass should do nothing.

PassScopeBase

Abstract superclass for concrete implementations of PassScope.