|
| | SDFGTranslator () |
| ::sdfg::builder::StructuredSDFGBuilder & | builder () |
| bool | builder_empty () |
| void | builder_empty (bool empty) |
| llvm::ScopedHashTable< Value, std::string > & | value_map () |
| ::sdfg::structured_control_flow::Sequence & | insertion_point () |
| void | enter_sequence (::sdfg::structured_control_flow::Sequence &sequence) |
| void | exit_sequence (::sdfg::structured_control_flow::Sequence &sequence) |
| std::unordered_map< std::string, TensorInfo > & | tensor_info_map () |
| TensorInfo & | get_or_create_tensor_info (const std::string &container, const TensorType &type) |
| std::string | get_or_create_container (Value val, bool argument=false) |
| std::unique_ptr<::sdfg::types::IType > | convertType (const Type mlir_type) |
| std::string | convertTypedAttr (const TypedAttr attr) |
| void | add_reference (const std::string &src_container, const std::string &dst_container, const ::sdfg::DebugInfo &deb_info=::sdfg::DebugInfo()) |
| void | handle_malloc (std::string container, const ::sdfg::symbolic::Expression size, const ::sdfg::DebugInfo &deb_info=::sdfg::DebugInfo()) |
| void | handle_frees (std::string return_container="", const ::sdfg::DebugInfo &deb_info=::sdfg::DebugInfo()) |
| std::string | get_or_copy_output_container (Value output, const ::sdfg::DebugInfo &deb_info=::sdfg::DebugInfo(), bool consumer_overwrites_output=false) |
| | If output is used as a DPS init by more than one linalg op, allocate a fresh copy via malloc + memcpy and return the new container name.
|
| void | record_constant_fill (Value result, Value value) |
| | Record that result is produced by a constant value linalg.fill whose materialization is deferred.
|
| bool | is_constant_fill (Value result) const |
| | Returns true if result was recorded via record_constant_fill.
|
| std::string | try_inplace_reuse_container (Value input, Value result) |
| | Returns the container of input if its buffer can be safely overwritten in place by an elementwise consumer producing result, otherwise the empty string.
|
| std::string | store_in_c_order (const std::string &container, const TensorInfo &tensor_info, const ::sdfg::types::Scalar &element_type, const ::sdfg::DebugInfo &deb_info=::sdfg::DebugInfo()) |
| void | set_output_args (const std::vector< std::string > &output_args) |
| | Set the output argument names for multi-output support.
|
| const std::vector< std::string > & | output_args () const |
| | Get the output argument names.
|
| void | copy_to_output (const std::string &src_container, const TensorInfo &tensor_info, const ::sdfg::types::Scalar &element_type, const std::string &output_container, const ::sdfg::DebugInfo &deb_info=::sdfg::DebugInfo()) |
| | Copy tensor data to an output argument container in C-order.
|
| void | copy_scalar_to_output (const std::string &src_container, const std::string &output_container, const ::sdfg::DebugInfo &deb_info=::sdfg::DebugInfo()) |
| | Copy scalar data to an output argument container.
|
| ::sdfg::DebugInfo | get_debug_info (llvm::StringLiteral operation_name, Location loc) |
| | Creates an SDFG debug info from an operation.
|
| std::string mlir::sdfg::SDFGTranslator::get_or_copy_output_container |
( |
Value | output, |
|
|
const ::sdfg::DebugInfo & | deb_info = ::sdfg::DebugInfo(), |
|
|
bool | consumer_overwrites_output = false ) |
If output is used as a DPS init by more than one linalg op, allocate a fresh copy via malloc + memcpy and return the new container name.
Otherwise return the original container for output. If consumer_overwrites_output is true, the caller guarantees it fully overwrites the returned buffer before reading it (e.g. matmul with beta=0), so the init copy is skipped and a fresh uninitialized buffer is handed out (the malloc still happens).
| std::string mlir::sdfg::SDFGTranslator::try_inplace_reuse_container |
( |
Value | input, |
|
|
Value | result ) |
Returns the container of input if its buffer can be safely overwritten in place by an elementwise consumer producing result, otherwise the empty string.
Conservatively limited to inputs produced by a matmul/batch_matmul: a fresh, fully-written, owned buffer used exactly once and matching the result's shape and element type. Lets the consumer reuse that buffer instead of allocating a new output, saving a malloc (and its free).