CIRCT  19.0.0git
Namespaces | Macros | Functions
HWArithToHW.cpp File Reference
#include "circt/Conversion/HWArithToHW.h"
#include "circt/Dialect/Comb/CombOps.h"
#include "circt/Dialect/HW/ConversionPatterns.h"
#include "circt/Dialect/HW/HWOps.h"
#include "circt/Dialect/HWArith/HWArithOps.h"
#include "circt/Dialect/MSFT/MSFTOps.h"
#include "circt/Dialect/SV/SVOps.h"
#include "circt/Dialect/Seq/SeqOps.h"
#include "mlir/Pass/Pass.h"
#include "mlir/Transforms/DialectConversion.h"
#include "llvm/ADT/TypeSwitch.h"
#include "circt/Conversion/Passes.h.inc"
Include dependency graph for HWArithToHW.cpp:

Go to the source code of this file.

Namespaces

 circt
 The InstanceGraph op interface, see InstanceGraphInterface.td for more details.
 

Macros

#define GEN_PASS_DEF_HWARITHTOHW
 

Functions

static void improveNamehint (Value oldValue, Operation *newOp, llvm::function_ref< std::string(StringRef)> namehintCallback)
 
static Value extractBits (OpBuilder &builder, Location loc, Value value, unsigned startBit, unsigned bitWidth)
 
static Value extendTypeWidth (OpBuilder &builder, Location loc, Value value, unsigned targetWidth, bool signExtension)
 
static bool isSignednessType (Type type)
 
static bool isSignednessAttr (Attribute attr)
 
static bool isLegalOp (Operation *op)
 Returns true if the given op is considered as legal for HWArith conversion. More...
 

Macro Definition Documentation

◆ GEN_PASS_DEF_HWARITHTOHW

#define GEN_PASS_DEF_HWARITHTOHW

Definition at line 27 of file HWArithToHW.cpp.

Function Documentation

◆ extendTypeWidth()

static Value extendTypeWidth ( OpBuilder &  builder,
Location  loc,
Value  value,
unsigned  targetWidth,
bool  signExtension 
)
static

Definition at line 75 of file HWArithToHW.cpp.

References extractBits(), and improveNamehint().

◆ extractBits()

static Value extractBits ( OpBuilder &  builder,
Location  loc,
Value  value,
unsigned  startBit,
unsigned  bitWidth 
)
static

Definition at line 57 of file HWArithToHW.cpp.

References improveNamehint().

Referenced by extendTypeWidth().

◆ improveNamehint()

static void improveNamehint ( Value  oldValue,
Operation *  newOp,
llvm::function_ref< std::string(StringRef)>  namehintCallback 
)
static

Definition at line 44 of file HWArithToHW.cpp.

References circt::calyx::direction::get().

Referenced by extendTypeWidth(), and extractBits().

◆ isLegalOp()

static bool isLegalOp ( Operation *  op)
static

Returns true if the given op is considered as legal for HWArith conversion.

Definition at line 135 of file HWArithToHW.cpp.

References isSignednessAttr(), and isSignednessType().

◆ isSignednessAttr()

static bool isSignednessAttr ( Attribute  attr)
static

Definition at line 127 of file HWArithToHW.cpp.

References isSignednessType().

Referenced by isLegalOp().

◆ isSignednessType()

static bool isSignednessType ( Type  type)
static

Definition at line 109 of file HWArithToHW.cpp.

Referenced by isLegalOp(), and isSignednessAttr().