CIRCT 22.0.0git
|
A sample reduction pattern that tries to remove aggregate wires by replacing all subaccesses with new independent wires. More...
Public Member Functions | |
void | beforeReduction (mlir::ModuleOp op) override |
Called before the reduction is applied to a new subset of operations. | |
void | afterReduction (mlir::ModuleOp op) override |
Called after the reduction has been applied to a subset of operations. | |
uint64_t | match (Operation *op) override |
Check if the reduction can apply to a specific operation. | |
LogicalResult | rewrite (Operation *op) override |
Apply the reduction to a specific operation. | |
std::string | getName () const override |
Return a human-readable name for this reduction pattern. | |
![]() | |
virtual | ~Reduction () |
virtual void | matches (Operation *op, llvm::function_ref< void(uint64_t, uint64_t)> addMatch) |
Collect all ways how this reduction can apply to a specific operation. | |
virtual LogicalResult | rewriteMatches (Operation *op, ArrayRef< uint64_t > matches) |
Apply a set of matches of this reduction to a specific operation. | |
virtual bool | acceptSizeIncrease () const |
Return true if the tool should accept the transformation this reduction performs on the module even if the overall size of the output increases. | |
virtual bool | isOneShot () const |
Return true if the tool should not try to reapply this reduction after it has been successful. | |
void | notifyOpErased (Operation *op) |
Public Attributes | |
llvm::DenseSet< Operation * > | opsToErase |
![]() | |
std::function< void(Operation *)> | notifyOpErasedCallback = nullptr |
An optional callback for reductions to communicate removal of operations. | |
A sample reduction pattern that tries to remove aggregate wires by replacing all subaccesses with new independent wires.
This can disentangle large unused wires that are otherwise difficult to collect due to the subaccesses.
Definition at line 854 of file FIRRTLReductions.cpp.
|
inlineoverridevirtual |
Called after the reduction has been applied to a subset of operations.
Reductions may use this callback to perform post-processing of the reductions before the resulting module is tried for interestingness.
Reimplemented from circt::Reduction.
Definition at line 856 of file FIRRTLReductions.cpp.
References opsToErase.
|
inlineoverridevirtual |
Called before the reduction is applied to a new subset of operations.
Reductions may use this callback to collect information such as symbol tables about the module upfront.
Reimplemented from circt::Reduction.
Definition at line 855 of file FIRRTLReductions.cpp.
References opsToErase.
|
inlineoverridevirtual |
Return a human-readable name for this reduction pattern.
Implements circt::Reduction.
Definition at line 895 of file FIRRTLReductions.cpp.
|
inlineoverridevirtual |
Check if the reduction can apply to a specific operation.
Returns a benefit measure where a higher number means that applying the pattern leads to a bigger reduction and zero means that the patten does not match and thus cannot be applied at all.
Reimplemented from circt::Reduction.
Definition at line 862 of file FIRRTLReductions.cpp.
Referenced by rewrite().
|
inlineoverridevirtual |
Apply the reduction to a specific operation.
If the returned result indicates that the application failed, the resulting module is treated the same as if the tester marked it as uninteresting.
Reimplemented from circt::Reduction.
Definition at line 872 of file FIRRTLReductions.cpp.
References assert(), match(), and opsToErase.
llvm::DenseSet<Operation *> DetachSubaccesses::opsToErase |
Definition at line 896 of file FIRRTLReductions.cpp.
Referenced by afterReduction(), beforeReduction(), and rewrite().