code: def test_prim_func_pass():
      @tvm.tir.transform.prim_func_pass(opt_level=1)
      class TestReplaceFunc:
          """Simple test function to replace one argument to another."""
  
          def __init__(self, new_func):
              self.new_func = new_func
  
          def transform_function(self, func, mod, ctx):
              return self.new_func
  
      x = te.var("x")
      y = te.var("y")
      b = tvm.tir.decl_buffer((x,), "float32")
      stmt = tvm.tir.LetStmt(x, 10, tvm.tir.Evaluate(x + 1))
  
      func = tvm.tir.PrimFunc([x, y, b], stmt)
  
      new_func = tvm.tir.PrimFunc([x, y, b], tvm.tir.Evaluate(0))
  
      mod = tvm.IRModule({"main": func})
      mod = TestReplaceFunc(new_func)(mod)
  
      assert tvm.ir.structural_equal(mod["main"].body, new_func.body)
  
imports: import tvm
  import tvm.testing
  from tvm import te
label_desc: Use image node_id 1 for calling a global function with example usage: test_prim_func_pass() and returns: self