CIRCT 23.0.0git
Loading...
Searching...
No Matches
Classes | Functions
DatapathFolds.cpp File Reference
#include "circt/Dialect/Comb/CombOps.h"
#include "circt/Dialect/Datapath/DatapathDialect.h"
#include "circt/Dialect/Datapath/DatapathOps.h"
#include "circt/Dialect/HW/HWOps.h"
#include "mlir/IR/Matchers.h"
#include "mlir/IR/PatternMatch.h"
#include "llvm/Support/Casting.h"
#include "llvm/Support/KnownBits.h"
#include <algorithm>
Include dependency graph for DatapathFolds.cpp:

Go to the source code of this file.

Classes

struct  FoldCompressIntoCompress
 
struct  FoldAddIntoCompress
 
struct  SextCompress
 
struct  OnesExtCompress
 
struct  ConstantFoldCompress
 
struct  ReduceNumPartialProducts
 
struct  SignedPartialProducts
 
struct  PosPartialProducts
 
struct  ReduceNumPosPartialProducts
 

Functions

static FailureOr< size_t > calculateNonZeroBits (Value operand, size_t numResults)
 
static FailureOr< Value > isOneExt (Value operand)
 
static Value zeroPad (PatternRewriter &rewriter, Location loc, Value input, size_t targetWidth, size_t trailingZeros)
 
static bool areAllCompressorResultsSummed (ValueRange compressResults, ValueRange operands)
 

Function Documentation

◆ areAllCompressorResultsSummed()

static bool areAllCompressorResultsSummed ( ValueRange  compressResults,
ValueRange  operands 
)
static

◆ calculateNonZeroBits()

static FailureOr< size_t > calculateNonZeroBits ( Value  operand,
size_t  numResults 
)
static

◆ isOneExt()

static FailureOr< Value > isOneExt ( Value  operand)
static

Definition at line 46 of file DatapathFolds.cpp.

Referenced by OnesExtCompress::matchAndRewrite().

◆ zeroPad()

static Value zeroPad ( PatternRewriter &  rewriter,
Location  loc,
Value  input,
size_t  targetWidth,
size_t  trailingZeros 
)
static

Definition at line 66 of file DatapathFolds.cpp.

References assert(), and hw.ConstantOp::create().

Referenced by SignedPartialProducts::matchAndRewrite().