MLIR  15.0.0git
Macros | Functions
SCCP.cpp File Reference
#include "PassDetail.h"
#include "mlir/Analysis/DataFlowAnalysis.h"
#include "mlir/IR/Builders.h"
#include "mlir/IR/Dialect.h"
#include "mlir/Interfaces/ControlFlowInterfaces.h"
#include "mlir/Interfaces/SideEffectInterfaces.h"
#include "mlir/Pass/Pass.h"
#include "mlir/Transforms/FoldUtils.h"
#include "mlir/Transforms/Passes.h"
#include "llvm/Support/Debug.h"
+ Include dependency graph for SCCP.cpp:

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "sccp"
 

Functions

static LogicalResult replaceWithConstant (SCCPAnalysis &analysis, OpBuilder &builder, OperationFolder &folder, Value value)
 Replace the given value with a constant if the corresponding lattice represents a constant. More...
 
static void rewrite (SCCPAnalysis &analysis, MLIRContext *context, MutableArrayRef< Region > initialRegions)
 Rewrite the given regions using the computing analysis. More...
 

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "sccp"

Definition at line 28 of file SCCP.cpp.

Function Documentation

◆ replaceWithConstant()

static LogicalResult replaceWithConstant ( SCCPAnalysis &  analysis,
OpBuilder builder,
OperationFolder folder,
Value  value 
)
static

Replace the given value with a constant if the corresponding lattice represents a constant.

Returns success if the value was replaced, failure otherwise.

Definition at line 170 of file SCCP.cpp.

References mlir::failure(), mlir::Value::getLoc(), mlir::OperationFolder::getOrCreateConstant(), mlir::Value::getType(), mlir::LatticeElement< ValueT >::getValue(), mlir::Value::replaceAllUsesWith(), and mlir::success().

◆ rewrite()

static void rewrite ( SCCPAnalysis &  analysis,
MLIRContext context,
MutableArrayRef< Region initialRegions 
)
static