CIRCT 22.0.0git
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Private Attributes | List of all members
circt::HWToLLVMArraySpillCache Struct Reference

Helper class mapping array values (HW or LLVM Dialect) to pointers to buffers containing the array value. More...

#include <HWToLLVM.h>

Collaboration diagram for circt::HWToLLVMArraySpillCache:
Collaboration graph
[legend]

Public Member Functions

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 lookup (Value arrayValue)
 Retrieve a pointer to a buffer containing the given array value (HW or LLVM Dialect).
 

Private Member Functions

Value spillLLVMArrayValue (OpBuilder &builder, Location loc, Value llvmArray)
 
Value spillHWArrayValue (OpBuilder &builder, Location loc, mlir::LLVMTypeConverter &converter, Value hwArray)
 

Private Attributes

llvm::DenseMap< Value, Value > spillMap
 

Detailed Description

Helper class mapping array values (HW or LLVM Dialect) to pointers to buffers containing the array value.

Definition at line 47 of file HWToLLVM.h.

Member Function Documentation

◆ lookup()

Value HWToLLVMArraySpillCache::lookup ( Value  arrayValue)

Retrieve a pointer to a buffer containing the given array value (HW or LLVM Dialect).

The buffer must not be modified or deallocated. Returns a null value if no buffer has been mapped.

Definition at line 142 of file HWToLLVM.cpp.

References assert(), and spillMap.

◆ map()

void HWToLLVMArraySpillCache::map ( mlir::Value  arrayValue,
mlir::Value  bufferPtr 
)

Map an LLVM array value to an LLVM pointer.

For the entire lifetime of the array value the pointer must refer to a valid buffer containing the respective array value.

Definition at line 134 of file HWToLLVM.cpp.

References assert(), and spillMap.

Referenced by spillLLVMArrayValue().

◆ spillHWArrayValue()

Value HWToLLVMArraySpillCache::spillHWArrayValue ( OpBuilder &  builder,
Location  loc,
mlir::LLVMTypeConverter &  converter,
Value  hwArray 
)
private

Definition at line 175 of file HWToLLVM.cpp.

References assert(), and spillLLVMArrayValue().

Referenced by spillNonHWOps().

◆ spillLLVMArrayValue()

Value HWToLLVMArraySpillCache::spillLLVMArrayValue ( OpBuilder &  builder,
Location  loc,
Value  llvmArray 
)
private

Definition at line 160 of file HWToLLVM.cpp.

References assert(), map(), and spillValueOnStack().

Referenced by spillHWArrayValue().

◆ spillNonHWOps()

void HWToLLVMArraySpillCache::spillNonHWOps ( mlir::OpBuilder &  builder,
mlir::LLVMTypeConverter &  converter,
Operation *  containerOp 
)

Spill HW array values produced by 'foreign' dialects on the stack.

The converter is used to map HW array types to the corresponding LLVM array types. Should be called before dialect conversion.

Definition at line 100 of file HWToLLVM.cpp.

References spillHWArrayValue().

Member Data Documentation

◆ spillMap

llvm::DenseMap<Value, Value> circt::HWToLLVMArraySpillCache::spillMap
private

Definition at line 70 of file HWToLLVM.h.

Referenced by lookup(), and map().


The documentation for this struct was generated from the following files: