|
MLIR 23.0.0git
|
This class represents a specific resource that an effect applies to. More...
#include "mlir/Interfaces/SideEffectInterfaces.h"
Classes | |
| class | Base |
| This base class is used for derived effects that are non-parametric. More... | |
Public Member Functions | |
| virtual | ~Resource ()=default |
| TypeID | getResourceID () const |
| Return the unique identifier for the base resource class. | |
| virtual StringRef | getName () const =0 |
| Return a string name of the resource. | |
| virtual Resource * | getParent () const |
| Return the parent resource in the hierarchy, or nullptr for a root. | |
| virtual bool | isAddressable () const |
| Returns true if this resource is addressable (effects on it can alias pointer-based memory). | |
| bool | isSubresourceOf (const Resource *other) const |
| Returns true if this resource is a subresource of (or equal to) another. | |
| bool | isDisjointFrom (const Resource *other) const |
| Returns true if this resource is disjoint from another. | |
Protected Member Functions | |
| Resource (TypeID id) | |
This class represents a specific resource that an effect applies to.
This class represents an abstract interface for a given resource. Resources form a hierarchy via getParent(); disjointness (isDisjointFrom) is used to determine whether effects can conflict.
Scope: The resource hierarchy is for disjointness of abstract resources (e.g. addressable memory vs. runtime state). It is deliberately not intended for fine-grained regions with specific addresses/sizes, or for alias classes / offset-based disambiguation; such concerns are out of scope and should be handled by alias analysis or other mechanisms.
Definition at line 88 of file SideEffectInterfaces.h.
|
virtualdefault |
|
inlineprotected |
Definition at line 156 of file SideEffectInterfaces.h.
Referenced by mlir::SideEffects::Resource::Base< DerivedResource, BaseResource >::classof(), getParent(), isDisjointFrom(), and isSubresourceOf().
|
pure virtual |
Return a string name of the resource.
Implemented in mlir::acc::ConstructResource, mlir::acc::CurrentDeviceIdResource, mlir::acc::RuntimeCounters, mlir::SideEffects::AutomaticAllocationScopeResource, mlir::SideEffects::DefaultResource, mlir::transform::PayloadIRResource, and mlir::transform::TransformMappingResource.
|
inlinevirtual |
Return the parent resource in the hierarchy, or nullptr for a root.
Reimplemented in mlir::SideEffects::AutomaticAllocationScopeResource.
Definition at line 131 of file SideEffectInterfaces.h.
References Resource().
|
inline |
Return the unique identifier for the base resource class.
Definition at line 125 of file SideEffectInterfaces.h.
Referenced by mayAlias().
|
inlinevirtual |
Returns true if this resource is addressable (effects on it can alias pointer-based memory).
Default is true.
Reimplemented in mlir::acc::ConstructResource, mlir::acc::CurrentDeviceIdResource, and mlir::acc::RuntimeCounters.
Definition at line 135 of file SideEffectInterfaces.h.
Returns true if this resource is disjoint from another.
Two resources are disjoint if neither is an ancestor of the other.
Definition at line 151 of file SideEffectInterfaces.h.
References isSubresourceOf(), and Resource().
Returns true if this resource is a subresource of (or equal to) another.
Definition at line 138 of file SideEffectInterfaces.h.
References Resource().
Referenced by mlir::SideEffects::Resource::Base< DerivedResource, BaseResource >::classof(), and isDisjointFrom().