CIRCT  19.0.0git
Functions
HWArithToHW.cpp File Reference
#include "circt/Conversion/HWArithToHW.h"
#include "../PassDetail.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/Transforms/DialectConversion.h"
#include "llvm/ADT/TypeSwitch.h"
Include dependency graph for HWArithToHW.cpp:

Go to the source code of this file.

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...
 

Function Documentation

◆ extendTypeWidth()

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

Definition at line 70 of file HWArithToHW.cpp.

References builder, extractBits(), and improveNamehint().

◆ extractBits()

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

Definition at line 52 of file HWArithToHW.cpp.

References builder, and improveNamehint().

Referenced by extendTypeWidth().

◆ improveNamehint()

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

Definition at line 39 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 130 of file HWArithToHW.cpp.

References isSignednessAttr(), and isSignednessType().

◆ isSignednessAttr()

static bool isSignednessAttr ( Attribute  attr)
static

Definition at line 122 of file HWArithToHW.cpp.

References isSignednessType().

Referenced by isLegalOp().

◆ isSignednessType()

static bool isSignednessType ( Type  type)
static

Definition at line 104 of file HWArithToHW.cpp.

Referenced by isLegalOp(), and isSignednessAttr().