24#ifndef TVM_S_TIR_ANALYSIS_H_
25#define TVM_S_TIR_ANALYSIS_H_
52 const s_tir::SBlock& block,
const ffi::Map<Var, TensorVar>& tensor_var_map);
63 const s_tir::SBlock& block,
const ffi::Map<Var, TensorVar>& tensor_var_map);
158 bool consider_loads,
bool consider_stores);
Managed reference to ForNode.
Definition stmt.h:511
Managed reference class to IRModuleNode.
Definition module.h:255
Container of all statements.
Definition stmt.h:62
Managed reference to TensorRegionNode.
Definition expr.h:1079
A block is a basic schedule unit in TIR.
Definition stmt.h:112
Managed reference to SBlockNode.
Definition stmt.h:164
Managed reference to AnalyzerObj.
Definition analyzer.h:916
Managed reference to FunctionNode.
Definition function.h:105
Checked zero-state view over an ordinary VarNode with TensorType.
Definition expr.h:50
PassContext that is used to configure the pass behavior.
Definition transform.h:62
IRModule that holds the functions and type definitions.
bool IsPureFunction(const Function &func, bool assert_on_error=false)
Analyze the side effect of a function.
bool VerifyVTCMLimit(const IRModule &mod, int64_t limit)
Verifies that the VTCM usage for all functions in the given IRModule.
ffi::Array< tvm::transform::Pass > GetVTCMCompactionPasses()
Get the list of lowering passes to calculate the compacted VTCM allocation size.
bool VerifyGPUCode(const Function &func, ffi::Map< ffi::String, PrimExpr > constraints)
Verify the correctness of a GPU code.
double EstimateTIRFlops(const Stmt &stmt)
Estimate the FLOPs of a TIR fragment.
ffi::Map< ffi::String, ffi::Map< ffi::String, int64_t > > CalculateAllocatedBytes(const Function &func)
Calculate the allocated memory per scope in bytes needed inside the TIR Function.
bool VerifyWellFormed(const tirx::Function &func, bool assert_mode=true)
Verify variable/tensor definitions, load types and schedulable block boundaries.
ffi::Array< ffi::Optional< Range > > DomainTouched(const Stmt &body, const TensorVar &tensor, bool consider_loads, bool consider_stores)
Infer the domain touched by tensor accesses within a statement.
std::optional< MemCpyDetails > IdentifyMemCpy(const For &loop, const sym::Analyzer &analyzer)
Identify whether a For loop is semantically equivalent to MemCpy.
Backend-defined execution hierarchy nodes shared by layouts and tile calls.
Definition axis_group_graph.h:41
ffi::Map< TensorVar, ffi::Optional< Stmt > > DetectTensorAccessLCA(const Function &func)
Detect the lowest common ancestor(LCA) of tensor access, including both high-level access(TensorLoad,...
const s_tir::SBlockNode * FindAnchorBlock(const IRModule &mod)
Find the "anchor block" of the given module. We define the anchor block to be the block with (1) an i...
ffi::Array< ffi::Array< TensorRegion > > GetSBlockAccessRegion(const s_tir::SBlock &block, const ffi::Map< Var, TensorVar > &tensor_var_map)
Auto detect the block access region according to its body stmt It will detect the access region as an...
ffi::Array< ffi::Array< TensorRegion > > GetSBlockReadWriteRegion(const s_tir::SBlock &block, const ffi::Map< Var, TensorVar > &tensor_var_map)
Auto detect the block read/write region according to its body stmt. An opaque access will be counted ...
An object that builds and maintains block scope and StmtSref mapping for Dependence analysis.
Definition attr.h:23
S-TIR (Schedulable TIR) statements and attributes.
Helper struct for return value of IdentifyMemCpy.
Definition analysis.h:137
TensorRegion source
Definition analysis.h:138
TensorRegion dest
Definition analysis.h:139
Compilation target object.
TIRx statements and shared statement entry header.