Peano
Loading...
Searching...
No Matches
MLIRPrinter.MLIRPrinter Class Reference
Inheritance diagram for MLIRPrinter.MLIRPrinter:
Collaboration diagram for MLIRPrinter.MLIRPrinter:

Public Member Functions

 __init__ (self, int spaces_per_tab, str internal_name)
str print_name (self, Name name, int indent_level=0)
str print_function_declaration (self, Function function, int indent_level=0)
str print_function_definition (self, Function function, int indent_level=0)
str print_function_declaration_with_timer (self, Function function, int indent_level=0)
str print_function_definition_with_timer (self, Function function, int indent_level=0)
str print_function_bridge (self, Function function, int indent_level=0)
SSAValue print_array_allocation (self, ArrayAllocation array_allocation, int indent_level=0)
 print_array_deallocation (self, ArrayDeallocation array_deallocation, int indent_level=0)
SSAValue print_memory_allocation (self, MemoryAllocation memory_allocation, int indent_level=0)
str print_memory_deallocation (self, MemoryDeallocation memory_deallocation, int indent_level=0)
 print_function_call (self, FunctionCall function_call, int indent_level=0)
 print_for (self, For for_loop, int indent_level=0)
 print_construction (self, Construction construction, int indent_level=0)
 print_assignment (self, Assignment assignment, int indent_level=0)
 print_data_block_construction_from_element (self, DataBlockConstructionFromElement data_block_construction_from_element, int indent_level=0)
 print_data_block_construction_from_external (self, DataBlockConstructionFromExternal data_block_construction_from_external, int indent_level=0)
 print_data_block_construction_from_function_call (self, DataBlockConstructionFromFunctionCall data_block_construction_from_function_call, int indent_level=0)
 print_data_block_construction_from_operation (self, DataBlockConstructionFromOperation data_block_construction_from_operation, int indent_level=0)
 print_data_block_assignment (self, DataBlockAssignment data_block_assignment, int indent_level=0)
str print_data_block_unary_max (self, DataBlockUnaryMax data_block_unary_max, int indent_level=0)
 print_comment (self, Comment comment, int indent_level=0)
SSAValue print_variable (self, Variable variable, int indent_level=0)
 Expression Prints.
SSAValue print_integer (self, Integer integer, int indent_level=0)
SSAValue print_index (self, Index index, int indent_level=0)
SSAValue print_float (self, Float float_val, int indent_level=0)
AffineExpr generate_affine_expression (self, Element|Variable element_node)
SSAValue print_subscript (self, Subscript subscript, int indent_level=0)
SSAValue print_element_binary_operation (self, ElementBinaryOperation element_binary_operation, int indent_level=0)
 print_element_unary_operation (self, ElementUnaryOperation element_unary_operation, int indent_level=0)
 print_element_index (self, ElementIndex element_index, int indent_level=0)
builtin.IntegerType print_integer_type (self, TInteger integer_type, int indent_level=0)
 Type Prints.
builtin.IndexType print_index_type (self, TIndex index_type, int indent_level=0)
builtin.Float64Type print_float_type (self, TFloat float_type, int indent_level=0)
 print_vector_type (self, TVector vector_type, int indent_level=0)
builtin.MemRefType print_array_type (self, TArray array_type, int indent_level=0)
Attribute print_struct_type (self, TStruct struct_type, int indent_level=0)
builtin.FunctionType print_function_type (self, TFunction function_type, int indent_level=0)

Data Fields

list builders = []
 output_string_stream = io.StringIO()
 xdsl_printer = xdsl.printer.Printer(stream=self.output_string_stream, indent_num_spaces=spaces_per_tab)
dict symbol_map = {}
dict struct_map = {}
int nested_affine_level = 0
dict affine_dimension_map = {}
dict affine_symbol_map = {}
 cpp_printer = CPPPrinter(spaces_per_tab)
 internal_name = internal_name

Static Public Attributes

 xdsl_memref_descriptor_1d
 xdsl_memref_descriptor_2d
 xdsl_memref_descriptor_nested

Detailed Description

Definition at line 34 of file MLIRPrinter.py.

Constructor & Destructor Documentation

◆ __init__()

MLIRPrinter.MLIRPrinter.__init__ ( self,
int spaces_per_tab,
str internal_name )

Definition at line 66 of file MLIRPrinter.py.

Member Function Documentation

◆ generate_affine_expression()

AffineExpr MLIRPrinter.MLIRPrinter.generate_affine_expression ( self,
Element | Variable element_node )

◆ print_array_allocation()

SSAValue MLIRPrinter.MLIRPrinter.print_array_allocation ( self,
ArrayAllocation array_allocation,
int indent_level = 0 )

◆ print_array_deallocation()

MLIRPrinter.MLIRPrinter.print_array_deallocation ( self,
ArrayDeallocation array_deallocation,
int indent_level = 0 )

Definition at line 215 of file MLIRPrinter.py.

◆ print_array_type()

builtin.MemRefType MLIRPrinter.MLIRPrinter.print_array_type ( self,
TArray array_type,
int indent_level = 0 )

Definition at line 821 of file MLIRPrinter.py.

References assert.

◆ print_assignment()

MLIRPrinter.MLIRPrinter.print_assignment ( self,
Assignment assignment,
int indent_level = 0 )

◆ print_comment()

MLIRPrinter.MLIRPrinter.print_comment ( self,
Comment comment,
int indent_level = 0 )

Definition at line 477 of file MLIRPrinter.py.

◆ print_construction()

MLIRPrinter.MLIRPrinter.print_construction ( self,
Construction construction,
int indent_level = 0 )

Definition at line 327 of file MLIRPrinter.py.

References assert, builders, MLIRPrinter.get_xdsl_type(), exahype2.api.dslhype2.Expressions.Variable.symbol_map, and symbol_map.

Here is the call graph for this function:

◆ print_data_block_assignment()

MLIRPrinter.MLIRPrinter.print_data_block_assignment ( self,
DataBlockAssignment data_block_assignment,
int indent_level = 0 )

Definition at line 471 of file MLIRPrinter.py.

◆ print_data_block_construction_from_element()

MLIRPrinter.MLIRPrinter.print_data_block_construction_from_element ( self,
DataBlockConstructionFromElement data_block_construction_from_element,
int indent_level = 0 )

Definition at line 389 of file MLIRPrinter.py.

◆ print_data_block_construction_from_external()

MLIRPrinter.MLIRPrinter.print_data_block_construction_from_external ( self,
DataBlockConstructionFromExternal data_block_construction_from_external,
int indent_level = 0 )

Definition at line 392 of file MLIRPrinter.py.

References assert, builders, MLIRPrinter.get_xdsl_type(), exahype2.api.dslhype2.Expressions.Variable.symbol_map, and symbol_map.

Here is the call graph for this function:

◆ print_data_block_construction_from_function_call()

MLIRPrinter.MLIRPrinter.print_data_block_construction_from_function_call ( self,
DataBlockConstructionFromFunctionCall data_block_construction_from_function_call,
int indent_level = 0 )

◆ print_data_block_construction_from_operation()

MLIRPrinter.MLIRPrinter.print_data_block_construction_from_operation ( self,
DataBlockConstructionFromOperation data_block_construction_from_operation,
int indent_level = 0 )

◆ print_data_block_unary_max()

str MLIRPrinter.MLIRPrinter.print_data_block_unary_max ( self,
DataBlockUnaryMax data_block_unary_max,
int indent_level = 0 )

Definition at line 474 of file MLIRPrinter.py.

◆ print_element_binary_operation()

SSAValue MLIRPrinter.MLIRPrinter.print_element_binary_operation ( self,
ElementBinaryOperation element_binary_operation,
int indent_level = 0 )

Definition at line 739 of file MLIRPrinter.py.

References assert, and builders.

◆ print_element_index()

MLIRPrinter.MLIRPrinter.print_element_index ( self,
ElementIndex element_index,
int indent_level = 0 )

◆ print_element_unary_operation()

MLIRPrinter.MLIRPrinter.print_element_unary_operation ( self,
ElementUnaryOperation element_unary_operation,
int indent_level = 0 )

Definition at line 778 of file MLIRPrinter.py.

References assert, and builders.

◆ print_float()

SSAValue MLIRPrinter.MLIRPrinter.print_float ( self,
Float float_val,
int indent_level = 0 )

Definition at line 501 of file MLIRPrinter.py.

References assert, and builders.

◆ print_float_type()

builtin.Float64Type MLIRPrinter.MLIRPrinter.print_float_type ( self,
TFloat float_type,
int indent_level = 0 )

Definition at line 815 of file MLIRPrinter.py.

◆ print_for()

MLIRPrinter.MLIRPrinter.print_for ( self,
For for_loop,
int indent_level = 0 )

◆ print_function_bridge()

str MLIRPrinter.MLIRPrinter.print_function_bridge ( self,
Function function,
int indent_level = 0 )

Definition at line 175 of file MLIRPrinter.py.

◆ print_function_call()

MLIRPrinter.MLIRPrinter.print_function_call ( self,
FunctionCall function_call,
int indent_level = 0 )

Definition at line 267 of file MLIRPrinter.py.

References assert, and builders.

◆ print_function_declaration()

str MLIRPrinter.MLIRPrinter.print_function_declaration ( self,
Function function,
int indent_level = 0 )

Definition at line 82 of file MLIRPrinter.py.

◆ print_function_declaration_with_timer()

str MLIRPrinter.MLIRPrinter.print_function_declaration_with_timer ( self,
Function function,
int indent_level = 0 )

Definition at line 153 of file MLIRPrinter.py.

◆ print_function_definition()

str MLIRPrinter.MLIRPrinter.print_function_definition ( self,
Function function,
int indent_level = 0 )

◆ print_function_definition_with_timer()

str MLIRPrinter.MLIRPrinter.print_function_definition_with_timer ( self,
Function function,
int indent_level = 0 )

Definition at line 161 of file MLIRPrinter.py.

References cpp_printer.

◆ print_function_type()

builtin.FunctionType MLIRPrinter.MLIRPrinter.print_function_type ( self,
TFunction function_type,
int indent_level = 0 )

Definition at line 843 of file MLIRPrinter.py.

◆ print_index()

SSAValue MLIRPrinter.MLIRPrinter.print_index ( self,
Index index,
int indent_level = 0 )

Definition at line 493 of file MLIRPrinter.py.

References assert, and builders.

◆ print_index_type()

builtin.IndexType MLIRPrinter.MLIRPrinter.print_index_type ( self,
TIndex index_type,
int indent_level = 0 )

Definition at line 812 of file MLIRPrinter.py.

◆ print_integer()

SSAValue MLIRPrinter.MLIRPrinter.print_integer ( self,
Integer integer,
int indent_level = 0 )

Definition at line 486 of file MLIRPrinter.py.

References assert, and builders.

◆ print_integer_type()

builtin.IntegerType MLIRPrinter.MLIRPrinter.print_integer_type ( self,
TInteger integer_type,
int indent_level = 0 )

Type Prints.

Definition at line 809 of file MLIRPrinter.py.

◆ print_memory_allocation()

SSAValue MLIRPrinter.MLIRPrinter.print_memory_allocation ( self,
MemoryAllocation memory_allocation,
int indent_level = 0 )

◆ print_memory_deallocation()

str MLIRPrinter.MLIRPrinter.print_memory_deallocation ( self,
MemoryDeallocation memory_deallocation,
int indent_level = 0 )

Definition at line 263 of file MLIRPrinter.py.

◆ print_name()

str MLIRPrinter.MLIRPrinter.print_name ( self,
Name name,
int indent_level = 0 )

Definition at line 79 of file MLIRPrinter.py.

◆ print_struct_type()

Attribute MLIRPrinter.MLIRPrinter.print_struct_type ( self,
TStruct struct_type,
int indent_level = 0 )

Definition at line 840 of file MLIRPrinter.py.

◆ print_subscript()

SSAValue MLIRPrinter.MLIRPrinter.print_subscript ( self,
Subscript subscript,
int indent_level = 0 )

◆ print_variable()

SSAValue MLIRPrinter.MLIRPrinter.print_variable ( self,
Variable variable,
int indent_level = 0 )

Expression Prints.

Definition at line 483 of file MLIRPrinter.py.

References exahype2.api.dslhype2.Expressions.Variable.symbol_map, and symbol_map.

◆ print_vector_type()

MLIRPrinter.MLIRPrinter.print_vector_type ( self,
TVector vector_type,
int indent_level = 0 )

Definition at line 818 of file MLIRPrinter.py.

Field Documentation

◆ affine_dimension_map

dict MLIRPrinter.MLIRPrinter.affine_dimension_map = {}

◆ affine_symbol_map

dict MLIRPrinter.MLIRPrinter.affine_symbol_map = {}

◆ builders

◆ cpp_printer

MLIRPrinter.MLIRPrinter.cpp_printer = CPPPrinter(spaces_per_tab)

Definition at line 75 of file MLIRPrinter.py.

Referenced by print_function_definition_with_timer().

◆ internal_name

MLIRPrinter.MLIRPrinter.internal_name = internal_name

Definition at line 76 of file MLIRPrinter.py.

Referenced by print_function_definition().

◆ nested_affine_level

int MLIRPrinter.MLIRPrinter.nested_affine_level = 0

Definition at line 72 of file MLIRPrinter.py.

Referenced by print_for().

◆ output_string_stream

MLIRPrinter.MLIRPrinter.output_string_stream = io.StringIO()

Definition at line 68 of file MLIRPrinter.py.

Referenced by print_function_definition().

◆ struct_map

dict MLIRPrinter.MLIRPrinter.struct_map = {}

Definition at line 71 of file MLIRPrinter.py.

Referenced by print_function_definition().

◆ symbol_map

◆ xdsl_memref_descriptor_1d

MLIRPrinter.MLIRPrinter.xdsl_memref_descriptor_1d
static
Initial value:
= llvm.LLVMStructType(
builtin.StringAttr(""),
builtin.ArrayAttr([
llvm.LLVMPointerType(),
llvm.LLVMPointerType(),
builtin.IntegerType(64),
llvm.LLVMArrayType(1, builtin.IntegerType(64)),
llvm.LLVMArrayType(1, builtin.IntegerType(64)),
]),
)

Definition at line 35 of file MLIRPrinter.py.

◆ xdsl_memref_descriptor_2d

MLIRPrinter.MLIRPrinter.xdsl_memref_descriptor_2d
static
Initial value:
= llvm.LLVMStructType(
builtin.StringAttr(""),
builtin.ArrayAttr([
llvm.LLVMPointerType(),
llvm.LLVMPointerType(),
builtin.IntegerType(64),
llvm.LLVMArrayType(2, builtin.IntegerType(64)),
llvm.LLVMArrayType(2, builtin.IntegerType(64)),
]),
)

Definition at line 45 of file MLIRPrinter.py.

◆ xdsl_memref_descriptor_nested

MLIRPrinter.MLIRPrinter.xdsl_memref_descriptor_nested
static
Initial value:
= llvm.LLVMStructType(
builtin.StringAttr(""),
builtin.ArrayAttr([
llvm.LLVMPointerType(),
llvm.LLVMPointerType(),
builtin.IntegerType(64),
llvm.LLVMArrayType(1, builtin.IntegerType(64)),
llvm.LLVMArrayType(1, builtin.IntegerType(64)),
]),
)

Definition at line 55 of file MLIRPrinter.py.

◆ xdsl_printer

MLIRPrinter.MLIRPrinter.xdsl_printer = xdsl.printer.Printer(stream=self.output_string_stream, indent_num_spaces=spaces_per_tab)

Definition at line 69 of file MLIRPrinter.py.

Referenced by print_function_definition().


The documentation for this class was generated from the following file: