MLIR
20.0.0git
|
#include <utility>
#include "mlir/Analysis/DataFlowFramework.h"
#include "mlir/Dialect/Arith/Transforms/Passes.h"
#include "mlir/Analysis/DataFlow/DeadCodeAnalysis.h"
#include "mlir/Analysis/DataFlow/IntegerRangeAnalysis.h"
#include "mlir/Dialect/Arith/IR/Arith.h"
#include "mlir/Dialect/Utils/StaticValueUtils.h"
#include "mlir/IR/IRMapping.h"
#include "mlir/IR/Matchers.h"
#include "mlir/IR/PatternMatch.h"
#include "mlir/IR/TypeUtilities.h"
#include "mlir/Interfaces/SideEffectInterfaces.h"
#include "mlir/Transforms/FoldUtils.h"
#include "mlir/Transforms/GreedyPatternRewriteDriver.h"
#include "mlir/Dialect/Arith/Transforms/Passes.h.inc"
Go to the source code of this file.
Namespaces | |
mlir | |
Include the generated interface declarations. | |
mlir::arith | |
Macros | |
#define | GEN_PASS_DEF_ARITHINTRANGEOPTS |
#define | GEN_PASS_DEF_ARITHINTRANGENARROWING |
Functions | |
static std::optional< APInt > | getMaybeConstantValue (DataFlowSolver &solver, Value value) |
static LogicalResult | maybeReplaceWithConstant (DataFlowSolver &solver, PatternRewriter &rewriter, Value value) |
Patterned after SCCP. More... | |
#define GEN_PASS_DEF_ARITHINTRANGENARROWING |
Definition at line 30 of file IntRangeOptimizations.cpp.
#define GEN_PASS_DEF_ARITHINTRANGEOPTS |
Definition at line 27 of file IntRangeOptimizations.cpp.
|
static |
Definition at line 38 of file IntRangeOptimizations.cpp.
References mlir::ConstantIntRanges::getConstantValue(), and mlir::DataFlowSolver::lookupState().
Referenced by maybeReplaceWithConstant().
|
static |
Patterned after SCCP.
Definition at line 50 of file IntRangeOptimizations.cpp.
References mlir::DenseIntElementsAttr::get(), mlir::Builder::getContext(), mlir::Value::getDefiningOp(), mlir::Operation::getDialect(), mlir::Builder::getIntegerAttr(), mlir::MLIRContext::getLoadedDialect(), mlir::Value::getLoc(), getMaybeConstantValue(), mlir::Region::getParentOp(), mlir::Value::getParentRegion(), mlir::Operation::getResult(), mlir::Value::getType(), materializeConstant(), mlir::Dialect::materializeConstant(), mlir::RewriterBase::replaceAllUsesWith(), and mlir::Value::use_empty().