tvm_tirx.tirx.transform#
Transformation passes for lowering and optimizing tensor-level IR.
Pass factories return callable passes: after = PassName()(before), where
before is an IRModule. Each pass example includes a complete input module,
expected output and invocation.
Pass decorator helpers#
|
A pass that transforms each |
|
Create a TIRx function pass from a callback or class. |
Passes#
Wrap each function body in a |
|
|
Apply ftransform to each function in the Module. |
|
Lower vectorization loops. |
Plan storage by moving allocations and reusing compatible storage. |
|
Rewrite pointer and tensor element types to match their accesses. |
|
Unroll loops with constant extents marked |
|
Remove effect-free statements and provably empty control flow. |
|
|
Hoist loop-invariant If statements outside eligible loops. |
Promote unsupported BF16 computations and internal temporaries to float32. |
|
|
Promote unsupported FP8 computations and internal temporaries. |
Represent BF16 storage as uint16 while preserving its bit patterns. |
|
Represent FP8 storage as uint8 while preserving its bit patterns. |
|
Replace redundant computations by new variables. |
|
Renormalize the split pattern from floordiv(floormod()) to floormod(floordiv()) |
|
Run statement-level arithmetic simplifications on the TIR Function. |
|
Lower |
|
Give every variable definition in an IRModule a distinct identity. |
|
Expose exported functions through the TVM FFI packed-call ABI. |
|
Annotate, split, and lower host/device functions. |
|
Replace assertion statements with no-ops. |
|
Lower runtime builtins to explicit stack storage and ABI operations. |
|
Lower intrinsic calls using rules registered for the function target. |
|
|
Narrow integer indices and loop variables when bounds prove it safe. |
Force index expressions to int32 without range proofs. |
|
Reject illegal host-side access to device memory. |
|
Flatten tensor allocations and accesses to one-dimensional storage. |
|
|
Bind targets and classify host/device helper functions. |
Infer and mark an unambiguous TIRx entry function. |
|
|
Remove TIRx functions for which |
Lower TIRx tile calls using the active backend dispatch table. |
|
Apply tensor layouts to physical storage and accesses. |