19#ifndef TVM_TIRX_SCRIPT_IR_BUILDER_FRAME_H_
20#define TVM_TIRX_SCRIPT_IR_BUILDER_FRAME_H_
60 ffi::Optional<ffi::String>
name;
68 ffi::Map<ffi::String, Any>
attrs;
78 namespace refl = tvm::ffi::reflection;
79 refl::ObjectDef<FunctionFrameObj>()
116 explicit FunctionFrame(ffi::ObjectPtr<FunctionFrameObj> data) : ir::StmtFrame(ffi::UnsafeInit{}) {
117 TVM_FFI_ICHECK(data !=
nullptr);
118 data_ = std::move(data);
A frame that represents the assert statement. Proceeds if the condition is true, otherwise aborts wit...
Definition frame.h:167
Managed reference to AssertFrameObj.
Definition frame.h:204
A frame that represents else.
Definition frame.h:391
Managed reference to ElseFrameObj.
Definition frame.h:417
A frame that represents the for loop.
Definition frame.h:110
Managed reference to ForFrameObj.
Definition frame.h:152
A frame that represents if statement.
Definition frame.h:304
Managed reference to IfFrameObj.
Definition frame.h:339
A result-free region with lexical body parameters.
Definition frame.h:217
Managed reference to RegionFrameObj.
Definition frame.h:247
A shared frame containing a sequence of core IR statements.
Definition frame.h:84
Managed reference to StmtFrameObj.
Definition frame.h:96
A frame that represents then.
Definition frame.h:352
Managed reference to ThenFrameObj.
Definition frame.h:378
A frame that represents while loop.
Definition frame.h:261
Managed reference to WhileFrameObj.
Definition frame.h:290
A frame that represents the Function containing TIR statements.
Definition frame.h:57
ffi::Optional< GlobalVar > global_var
Definition frame.h:75
bool is_private
Whether the Function is annotated as private.
Definition frame.h:64
ffi::Array< tvm::Var > args
Function parameters.
Definition frame.h:62
ffi::Map< ffi::String, Any > attrs
Additional attributes storing the meta-data.
Definition frame.h:68
TVM_FFI_DECLARE_OBJECT_INFO("script.ir_builder.tirx.FunctionFrame", FunctionFrameObj, ir::StmtFrameObj)
ffi::Optional< Type > ret_type
The return type of the function.
Definition frame.h:66
std::function< void(const FunctionFrameObj *, const ffi::Any &)> AttrValidator
Register validation for an extension-owned function attribute.
Definition frame.h:101
void ValidateAttrs() const
bool is_declaration
Whether this frame declares a bodyless signature.
Definition frame.h:72
bool persistent
Whether it is a persistent kernel.
Definition frame.h:70
void ExitWithScope() final
The method called when exiting RAII scope.
virtual tvm::tirx::Function FinalizeFunction(tvm::tirx::Function func)
Complete dialect-specific function construction before publication.
ffi::Optional< tvm::tirx::Function > function
Finalized function and its module identity.
Definition frame.h:74
static void RegisterReflection()
Definition frame.h:77
static void RegisterAttrValidator(ffi::String key, AttrValidator validator)
ffi::Optional< ffi::String > name
The name of the block.
Definition frame.h:60
Managed reference to FunctionFrameObj.
Definition frame.h:114
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NOTNULLABLE(FunctionFrame, ir::StmtFrame, FunctionFrameObj)
FunctionFrame(ffi::ObjectPtr< FunctionFrameObj > data)
Definition frame.h:116
FunctionFrame Function(bool is_private, bool persistent=false)
The primitive function statement.
An object that builds and maintains block scope and StmtSref mapping for Dependence analysis.
Definition attr.h:23
TIRx statements and shared statement entry header.