CIRCT 22.0.0git
Loading...
Searching...
No Matches
Macros | Functions
CutRewriter.cpp File Reference
#include "circt/Dialect/Synth/Transforms/CutRewriter.h"
#include "circt/Dialect/AIG/AIGOps.h"
#include "circt/Dialect/Comb/CombOps.h"
#include "circt/Dialect/HW/HWOps.h"
#include "circt/Support/LLVM.h"
#include "circt/Support/NPNClass.h"
#include "circt/Support/UnusedOpPruner.h"
#include "mlir/Analysis/TopologicalSortUtils.h"
#include "mlir/IR/Builders.h"
#include "mlir/IR/Operation.h"
#include "mlir/IR/RegionKindInterface.h"
#include "mlir/IR/Value.h"
#include "mlir/IR/ValueRange.h"
#include "mlir/IR/Visitors.h"
#include "mlir/Support/LLVM.h"
#include "llvm/ADT/APInt.h"
#include "llvm/ADT/Bitset.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/MapVector.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/ScopeExit.h"
#include "llvm/ADT/SetVector.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/iterator.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/LogicalResult.h"
#include <algorithm>
#include <functional>
#include <memory>
#include <optional>
#include <string>
Include dependency graph for CutRewriter.cpp:

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "synth-cut-rewriter"
 

Functions

static bool isSupportedLogicOp (mlir::Operation *op)
 
static void simulateLogicOp (Operation *op, DenseMap< Value, llvm::APInt > &eval)
 
static bool isAlwaysCutInput (Value value)
 
static bool compareDelayAndArea (OptimizationStrategy strategy, double newArea, ArrayRef< DelayType > newDelay, double oldArea, ArrayRef< DelayType > oldDelay)
 
template<typename OpRange >
static FailureOr< BinaryTruthTablecomputeTruthTable (mlir::ValueRange values, const OpRange &ops, const llvm::SmallSetVector< mlir::Value, 4 > &inputArgs)
 Get the truth table for an op.
 
static Cut getAsTrivialCut (mlir::Value value)
 
static bool isCutDerivedFromOperand (const Cut &cut, Operation *op)
 
static void removeDuplicateAndNonMinimalCuts (SmallVectorImpl< Cut > &cuts)
 
static StringRef getTestVariableName (Value value, DenseMap< OperationName, unsigned > &opCounter)
 Generate a human-readable name for a value used in test output.
 

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "synth-cut-rewriter"

Definition at line 55 of file CutRewriter.cpp.

Function Documentation

◆ compareDelayAndArea()

static bool compareDelayAndArea ( OptimizationStrategy  strategy,
double  newArea,
ArrayRef< DelayType newDelay,
double  oldArea,
ArrayRef< DelayType oldDelay 
)
static

◆ computeTruthTable()

template<typename OpRange >
static FailureOr< BinaryTruthTable > computeTruthTable ( mlir::ValueRange  values,
const OpRange &  ops,
const llvm::SmallSetVector< mlir::Value, 4 > &  inputArgs 
)
static

◆ getAsTrivialCut()

static Cut getAsTrivialCut ( mlir::Value  value)
static

◆ getTestVariableName()

static StringRef getTestVariableName ( Value  value,
DenseMap< OperationName, unsigned > &  opCounter 
)
static

Generate a human-readable name for a value used in test output.

This function creates meaningful names for values to make debug output and test results more readable and understandable.

Definition at line 803 of file CutRewriter.cpp.

Referenced by circt::synth::CutEnumerator::dump().

◆ isAlwaysCutInput()

static bool isAlwaysCutInput ( Value  value)
static

◆ isCutDerivedFromOperand()

static bool isCutDerivedFromOperand ( const Cut cut,
Operation *  op 
)
static

◆ isSupportedLogicOp()

static bool isSupportedLogicOp ( mlir::Operation *  op)
static

◆ removeDuplicateAndNonMinimalCuts()

static void removeDuplicateAndNonMinimalCuts ( SmallVectorImpl< Cut > &  cuts)
static

Definition at line 467 of file CutRewriter.cpp.

Referenced by circt::synth::CutSet::finalize().

◆ simulateLogicOp()

static void simulateLogicOp ( Operation *  op,
DenseMap< Value, llvm::APInt > &  eval 
)
static

Definition at line 66 of file CutRewriter.cpp.

References assert(), and isSupportedLogicOp().

Referenced by computeTruthTable().