CIRCT 24.0.0git
Loading...
Searching...
No Matches
LowerVariadic.cpp File Reference
#include "circt/Dialect/Comb/CombDialect.h"
#include "circt/Dialect/Comb/CombOps.h"
#include "circt/Dialect/HW/HWDialect.h"
#include "circt/Dialect/HW/HWOps.h"
#include "circt/Dialect/Synth/Analysis/LongestPathAnalysis.h"
#include "circt/Dialect/Synth/SynthOps.h"
#include "circt/Dialect/Synth/Transforms/SynthPasses.h"
#include "mlir/Analysis/TopologicalSortUtils.h"
#include "mlir/IR/Block.h"
#include "mlir/IR/OpDefinition.h"
#include "mlir/IR/PatternMatch.h"
#include "mlir/IR/Value.h"
#include "mlir/Support/LLVM.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/Support/Casting.h"
#include "llvm/Support/Error.h"
#include "llvm/Support/LogicalResult.h"
#include "llvm/Support/raw_ostream.h"
#include <iterator>
#include <vector>
#include "circt/Dialect/Synth/Transforms/SynthPasses.h.inc"
Include dependency graph for LowerVariadic.cpp:

Go to the source code of this file.

Classes

struct  llvm::DenseMapInfo< OperandKey >
struct  OperandPairLess

Namespaces

namespace  circt
 The InstanceGraph op interface, see InstanceGraphInterface.td for more details.
namespace  circt::synth
namespace  llvm

Macros

#define DEBUG_TYPE   "synth-lower-variadic"
#define GEN_PASS_DEF_LOWERVARIADIC

Typedefs

using OperandKey = llvm::SmallVector<std::pair<mlir::Value, bool>>

Functions

static LogicalResult replaceWithBalancedTree (IncrementalLongestPathAnalysis *analysis, mlir::IRRewriter &rewriter, Operation *op, llvm::function_ref< bool(OpOperand &)> isInverted, llvm::function_ref< Value(ValueWithArrivalTime, ValueWithArrivalTime)> createBinaryOp)
 Construct a balanced binary tree from a variadic operation using a delay-aware algorithm.
static OperandKey getSortedOperandKey (aig::AndInverterOp op)
static void simplifyWithExistingOperations (aig::AndInverterOp op, mlir::IRRewriter &rewriter, llvm::DenseMap< OperandKey, mlir::Value > &seenExpressions)

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "synth-lower-variadic"

Definition at line 35 of file LowerVariadic.cpp.

◆ GEN_PASS_DEF_LOWERVARIADIC

#define GEN_PASS_DEF_LOWERVARIADIC

Definition at line 39 of file LowerVariadic.cpp.

Typedef Documentation

◆ OperandKey

using OperandKey = llvm::SmallVector<std::pair<mlir::Value, bool>>

Definition at line 107 of file LowerVariadic.cpp.

Function Documentation

◆ getSortedOperandKey()

OperandKey getSortedOperandKey ( aig::AndInverterOp op)
static

Definition at line 153 of file LowerVariadic.cpp.

Referenced by simplifyWithExistingOperations().

◆ replaceWithBalancedTree()

LogicalResult replaceWithBalancedTree ( IncrementalLongestPathAnalysis * analysis,
mlir::IRRewriter & rewriter,
Operation * op,
llvm::function_ref< bool(OpOperand &)> isInverted,
llvm::function_ref< Value(ValueWithArrivalTime, ValueWithArrivalTime)> createBinaryOp )
static

Construct a balanced binary tree from a variadic operation using a delay-aware algorithm.

This function builds the tree by repeatedly combining the two values with the earliest arrival times, which minimizes the critical path delay.

Definition at line 64 of file LowerVariadic.cpp.

References failure(), and success().

◆ simplifyWithExistingOperations()

void simplifyWithExistingOperations ( aig::AndInverterOp op,
mlir::IRRewriter & rewriter,
llvm::DenseMap< OperandKey, mlir::Value > & seenExpressions )
static

Definition at line 162 of file LowerVariadic.cpp.

References getSortedOperandKey().