code: def test_copy_pad_split():
      m = 4 * 3
      A = te.placeholder((m,), name="A")
      Apad = te.compute(
          (m + 2,),
          lambda i: tvm.tir.if_then_else(
              tvm.tir.all(i >= 1, i <= m), A[i - 1], 0.0
          ),
          "Apad",
      )
      B = te.compute(
          (m,), lambda i: Apad[i] + Apad[i + 1] + Apad[i + 2]
      )
      s = te.create_schedule(B.op)
      xo, xi = s[B].split(B.op.axis[0], factor=4)
      s[Apad].compute_at(s[B], xo)
      s[Apad].pragma(s[Apad].op.axis[0], "memcpy")
  
      mod = schedule_to_module(s, [A, B])
      mod = tvm.tir.transform.StorageFlatten(64)(mod._move())
      mod = tvm.tir.transform.Simplify()(mod._move())
  
      def cb(src, dst, pad_before, pad_after, pad_value):
          assert dst.elem_offset.value == 0
          tvm.testing.assert_prim_expr_equal(
              src.elem_offset, tvm.te.max(xo * 4, 1) - 1
          )
  
          rpad_before = tvm.te.max(1 - xo * 4, 0)
          rpad_after = tvm.te.max(xo * 4 - 7, 0)
          tvm.testing.assert_prim_expr_equal(pad_before[0], rpad_before)
          tvm.testing.assert_prim_expr_equal(pad_after[0], rpad_after)
          tvm.testing.assert_prim_expr_equal(
              src.shape[0], 6 - rpad_before - rpad_after
          )
          return tvm.tir.Evaluate(0)
  
      stmt = tvm.tir.transform.InjectCopyIntrin("memcpy", cb)(mod)[
          "main"
      ].body
  
file_path: tvm/tests/python/tir-transform/test_tir_transform_inject_copy_intrin.py
imports: import tvm
  import tvm.testing
  from tvm import te
  from tvm.driver.build_module import schedule_to_module
label_desc: Use image node_id 4 for calling a global function with example usage: test_copy_pad_split() and returns: tvm