CIRCT 21.0.0git
|
Utility that tracks operations that have potentially become unused and allows them to be cleaned up at a later point. More...
#include <UnusedOpPruner.h>
Public Member Functions | |
void | eraseLaterIfUnused (Operation *op) |
Mark an op the be erased later if it is unused at that point. | |
void | eraseLaterIfUnused (Value value) |
Mark the defining op of a value to be erased later if the op is unused at that point. | |
void | eraseLaterIfUnused (ValueRange values) |
Mark the defining ops of a range of values to be erased later if the ops are unused at that point. | |
void | eraseNow (Operation *op) |
Erase an operation immediately, and remove it from the set of ops to be removed later. | |
void | eraseNow () |
Private Attributes | |
llvm::SmallDenseSet< Operation * > | opsToEraseIfUnused |
The set of operations that may have become unused. | |
llvm::SmallDenseSet< BlockArgument > | blockArgsToEraseIfUnused |
The set of block arguments that may have become unused. | |
Utility that tracks operations that have potentially become unused and allows them to be cleaned up at a later point.
Useful to make passes clean up dead code.
Definition at line 22 of file UnusedOpPruner.h.
|
inline |
Mark an op the be erased later if it is unused at that point.
Definition at line 24 of file UnusedOpPruner.h.
References assert(), and opsToEraseIfUnused.
Referenced by eraseLaterIfUnused(), eraseLaterIfUnused(), eraseNow(), and eraseNow().
|
inline |
Mark the defining op of a value to be erased later if the op is unused at that point.
Definition at line 31 of file UnusedOpPruner.h.
References blockArgsToEraseIfUnused, and eraseLaterIfUnused().
|
inline |
Mark the defining ops of a range of values to be erased later if the ops are unused at that point.
Definition at line 42 of file UnusedOpPruner.h.
References eraseLaterIfUnused().
|
inline |
Definition at line 57 of file UnusedOpPruner.h.
References blockArgsToEraseIfUnused, eraseLaterIfUnused(), and opsToEraseIfUnused.
|
inline |
Erase an operation immediately, and remove it from the set of ops to be removed later.
The op is erase regardless of whether it has any side effects or not.
Definition at line 50 of file UnusedOpPruner.h.
References eraseLaterIfUnused(), and opsToEraseIfUnused.
|
private |
The set of block arguments that may have become unused.
Definition at line 96 of file UnusedOpPruner.h.
Referenced by eraseLaterIfUnused(), and eraseNow().
|
private |
The set of operations that may have become unused.
Definition at line 94 of file UnusedOpPruner.h.
Referenced by eraseLaterIfUnused(), eraseNow(), and eraseNow().