code: def build_tir_func(func):
      func = func.with_attr("global_symbol", "main")
      pass_ctx = PassContext.current()
      if pass_ctx.config.get("tir.noalias", True):
          func = func.with_attr("tir.noalias", True)
      mod = tvm.IRModule({"main": func})
      func = tvm.build(mod)
      return func
  
file_path: tvm/tests/python/tir-base/test_tir_base.py
imports: import tvm
  import pytest
  from tvm import tir
  from tvm._ffi.base import TVMError
  from tvm.ir.transform import PassContext
  import itertools
  import pytest
label_desc: Use image node_id 1 for calling a global function with example usage: build_tir_func(func) and returns: func