MLIR
22.0.0git
|
#include "mlir/Dialect/Arith/IR/Arith.h"
#include "mlir/Dialect/SCF/IR/SCF.h"
#include "mlir/Dialect/SCF/Transforms/Passes.h"
#include "mlir/Dialect/SCF/Transforms/Passes.h.inc"
Go to the source code of this file.
Namespaces | |
mlir | |
Include the generated interface declarations. | |
Macros | |
#define | GEN_PASS_DEF_SCFIFCONDITIONPROPAGATION |
Functions | |
static void | propagateIfConditionsImpl (Operation *root, llvm::SmallPtrSet< Region *, 8 > &visited) |
Traverses the IR recursively (on region tree) and updates the uses of a value also as the condition of an scf.if to either true or false constants in the then and else regions. More... | |
static void | propagateIfConditions (Operation *root) |
Traverses the IR recursively (on region tree) and updates the uses of a value also as the condition of an scf.if to either true or false constants in the then and `else regions. More... | |
#define GEN_PASS_DEF_SCFIFCONDITIONPROPAGATION |
Definition at line 21 of file IfConditionPropagation.cpp.
|
static |
Traverses the IR recursively (on region tree) and updates the uses of a value also as the condition of an scf.if
to either true
or false
constants in the then
and `else regions.
Definition at line 87 of file IfConditionPropagation.cpp.
References propagateIfConditionsImpl().
|
static |
Traverses the IR recursively (on region tree) and updates the uses of a value also as the condition of an scf.if
to either true
or false
constants in the then
and else regions.
This is done as a single post-order sweep over the IR (withoutwalk`) for efficiency reasons. While traversing, the function maintains the set of visited regions to quickly identify whether the value belong to a region that is known to be nested in the then
or else
branch of a specific loop.
Definition at line 32 of file IfConditionPropagation.cpp.
References mlir::arith::ConstantIntOp::create(), mlir::Operation::erase(), mlir::Value::getDefiningOp(), mlir::Operation::getRegions(), and mlir::Value::getUses().
Referenced by propagateIfConditions().