14#ifndef CIRCT_CONVERSION_HWTOLLVM_HWTOLLVM_H
15#define CIRCT_CONVERSION_HWTOLLVM_HWTOLLVM_H
22class LLVMTypeConverter;
30#define GEN_PASS_DECL_CONVERTHWTOLLVM
31#include "circt/Conversion/Passes.h.inc"
52 mlir::LLVMTypeConverter &converter,
53 Operation *containerOp);
58 void map(mlir::Value arrayValue, mlir::Value bufferPtr);
63 Value
lookup(Value arrayValue);
68 mlir::LLVMTypeConverter &converter, Value hwArray);
80 mlir::LLVMTypeConverter &converter, RewritePatternSet &
patterns,
82 DenseMap<std::pair<Type, ArrayAttr>, mlir::LLVM::GlobalOp>
83 &constAggregateGlobalsMap,
84 std::optional<HWToLLVMArraySpillCache> &spillCacheOpt);
A namespace that is used to store existing names and generate new names in some scope within the IR.
The InstanceGraph op interface, see InstanceGraphInterface.td for more details.
void populateHWToLLVMTypeConversions(mlir::LLVMTypeConverter &converter)
Get the HW to LLVM type conversions.
void populateHWToLLVMConversionPatterns(mlir::LLVMTypeConverter &converter, RewritePatternSet &patterns, Namespace &globals, DenseMap< std::pair< Type, ArrayAttr >, mlir::LLVM::GlobalOp > &constAggregateGlobalsMap, std::optional< HWToLLVMArraySpillCache > &spillCacheOpt)
Get the HW to LLVM conversion patterns.
Helper class mapping array values (HW or LLVM Dialect) to pointers to buffers containing the array va...
Value spillHWArrayValue(OpBuilder &builder, Location loc, mlir::LLVMTypeConverter &converter, Value hwArray)
Value lookup(Value arrayValue)
Retrieve a pointer to a buffer containing the given array value (HW or LLVM Dialect).
void spillNonHWOps(mlir::OpBuilder &builder, mlir::LLVMTypeConverter &converter, Operation *containerOp)
Spill HW array values produced by 'foreign' dialects on the stack.
void map(mlir::Value arrayValue, mlir::Value bufferPtr)
Map an LLVM array value to an LLVM pointer.
Value spillLLVMArrayValue(OpBuilder &builder, Location loc, Value llvmArray)
llvm::DenseMap< Value, Value > spillMap
static uint32_t convertToLLVMEndianess(Type type, uint32_t index)
Convert an index into a HW ArrayType or StructType to LLVM Endianess.
static uint32_t llvmIndexOfStructField(hw::StructType type, StringRef fieldName)
Get the index of a specific StructType field in the LLVM lowering of the StructType.