tvm_tirx.tirx.transform.LowerIntrin#
- tvm_tirx.tirx.transform.LowerIntrin()#
Lower intrinsic calls using rules registered for the function target.
Requires a function
targetattribute. Also lowers logical tensor pointer operations to address operations.- Returns:
fpass (tvm_tirx.ir.transform.Pass) – The result pass
Examples
import tvm_tirx as tvm from tvm_tirx.script import ir as I, tirx as T from tvm_tirx.tirx import transform as tr @I.ir_module class Before: @T.function(private=True) def main(A: T.Tensor((1,), T.int32), x: T.int32): T.func_attr({"target": T.target("llvm")}) A[0] = x // 8 @I.ir_module class Expected: @T.function(private=True) def main(A: T.Tensor((1,), T.int32), x: T.int32): T.func_attr({"target": T.target("llvm")}) A[0] = x >> 3 def run_pass(): return tr.LowerIntrin()(Before) tvm.ir.assert_structural_equal(run_pass(), Expected)