CIRCT 24.0.0git
Loading...
Searching...
No Matches
HWToLLVM.cpp File Reference
#include "circt/Conversion/HWToLLVM.h"
#include "circt/Dialect/HW/HWOps.h"
#include "circt/Support/LLVM.h"
#include "circt/Support/Namespace.h"
#include "mlir/Conversion/LLVMCommon/ConversionTarget.h"
#include "mlir/Conversion/LLVMCommon/Pattern.h"
#include "mlir/Dialect/Func/IR/FuncOps.h"
#include "mlir/Dialect/Func/Transforms/FuncConversions.h"
#include "mlir/Dialect/LLVMIR/LLVMDialect.h"
#include "mlir/IR/Iterators.h"
#include "mlir/Interfaces/DataLayoutInterfaces.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 HWToLLVM.cpp:

Go to the source code of this file.

Namespaces

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

Macros

#define GEN_PASS_DEF_CONVERTHWTOLLVM

Functions

static Value zextByOne (Location loc, ConversionPatternRewriter &rewriter, Value value)
 Create a zext operation by one bit on the given value.
static Value spillValueOnStack (OpBuilder &builder, Location loc, Value spillVal)
static Type convertArrayType (hw::ArrayType type, LLVMTypeConverter &converter)
static Type convertStructType (hw::StructType type, LLVMTypeConverter &converter)
static Type convertUnionType (hw::UnionType type, DataLayout &layout, LLVMTypeConverter &converter)
 Convert a union to a flat byte buffer large enough to hold the LLVM representation of its widest member, including any alignment padding.

Macro Definition Documentation

◆ GEN_PASS_DEF_CONVERTHWTOLLVM

#define GEN_PASS_DEF_CONVERTHWTOLLVM

Definition at line 29 of file HWToLLVM.cpp.

Function Documentation

◆ convertArrayType()

Type convertArrayType ( hw::ArrayType type,
LLVMTypeConverter & converter )
static

Definition at line 854 of file HWToLLVM.cpp.

◆ convertStructType()

Type convertStructType ( hw::StructType type,
LLVMTypeConverter & converter )
static

◆ convertUnionType()

Type convertUnionType ( hw::UnionType type,
DataLayout & layout,
LLVMTypeConverter & converter )
static

Convert a union to a flat byte buffer large enough to hold the LLVM representation of its widest member, including any alignment padding.

Definition at line 874 of file HWToLLVM.cpp.

◆ spillValueOnStack()

Value spillValueOnStack ( OpBuilder & builder,
Location loc,
Value spillVal )
static

Definition at line 90 of file HWToLLVM.cpp.

References assert().

Referenced by circt::HWToLLVMArraySpillCache::spillLLVMArrayValue().

◆ zextByOne()

Value zextByOne ( Location loc,
ConversionPatternRewriter & rewriter,
Value value )
static

Create a zext operation by one bit on the given value.

This is useful when passing unsigned indexes to a GEP instruction, which treats indexes as signed values, to avoid unexpected "sign overflows".

Definition at line 78 of file HWToLLVM.cpp.