[TIR] Fix perf regression of tir refactor (#5258)
authorTianqi Chen <tqchen@users.noreply.github.com>
Tue, 7 Apr 2020 17:24:55 +0000 (10:24 -0700)
committerGitHub <noreply@github.com>
Tue, 7 Apr 2020 17:24:55 +0000 (10:24 -0700)
python/tvm/driver/build_module.py
python/tvm/testing.py
src/driver/driver_api.cc
tests/python/unittest/test_target_codegen_static_init.py
tests/python/unittest/test_target_codegen_vm_basic.py
tests/python/unittest/test_tir_transform_make_packed_api.py

index 0dd01e1..c0e990e 100644 (file)
@@ -198,7 +198,7 @@ def lower(sch,
     f = tvm.tir.PrimFunc(arg_list, stmt).with_attr(
         "global_symbol", tvm.runtime.String(name))
     if cfg.restricted_func:
-        f = f.with_attr("tir.no_alias", True)
+        f = f.with_attr("tir.noalias", True)
     mod = tvm.IRModule({name: f})
     return tvm.tir.transform.MakePackedAPI()(mod)
 
index 9c42930..1edb3b8 100644 (file)
@@ -199,7 +199,7 @@ def MakeAPILegacy(stmt, name, args, num_unpacked_args, noalias):
         "global_symbol", tvm.runtime.String(name))
     f = f.with_attr("tir.is_entry_func", True)
     if noalias:
-        f = f.with_attr("tir.no_alias", True)
+        f = f.with_attr("tir.noalias", True)
     mod = tvm.IRModule({name: f})
     return tvm.tir.transform.MakePackedAPI(num_unpacked_args)(mod)
 
index ae1d539..f939f0a 100644 (file)
@@ -214,7 +214,7 @@ IRModule lower(te::Schedule sch,
   f = WithAttr(std::move(f), "global_symbol", runtime::String(name));
 
   if (config->restricted_func) {
-    f = WithAttr(std::move(f), "tir.no_alias", Integer(1));
+    f = WithAttr(std::move(f), "tir.noalias", Integer(1));
   }
   auto mod = IRModule(Map<GlobalVar, BaseFunc>({{GlobalVar(name), f}}));
   return tir::transform::MakePackedAPI(0)(mod);
index bd4d0d8..64bb698 100644 (file)
@@ -26,7 +26,7 @@ def MakeAPILegacy(stmt, name, args, num_unpacked_args, noalias):
         "global_symbol", tvm.runtime.String(name))
     f = f.with_attr("tir.is_entry_func", True)
     if noalias:
-        f = f.with_attr("tir.no_alias", True)
+        f = f.with_attr("tir.noalias", True)
     mod = tvm.IRModule.from_expr(f)
     return tvm.tir.transform.MakePackedAPI()(mod)
 
index ee0d89b..6af4279 100644 (file)
@@ -33,7 +33,7 @@ def MakeAPILegacy(stmt, name, args, num_unpacked_args, noalias):
         "global_symbol", tvm.runtime.String(name))
     f = f.with_attr("tir.is_entry_func", True)
     if noalias:
-        f = f.with_attr("tir.no_alias", True)
+        f = f.with_attr("tir.noalias", True)
     mod = tvm.IRModule.from_expr(f)
     return tvm.tir.transform.MakePackedAPI()(mod)
 
index b44d3c4..898b08e 100644 (file)
@@ -36,7 +36,7 @@ def test_makeapi():
 
     num_unpacked_args = 2
     f = tvm.tir.PrimFunc([n, Ab, Bb, Cb], stmt).with_attr(
-        "tir.no_alias", True).with_attr("global_symbol", tvm.runtime.String("myadd"))
+        "tir.noalias", True).with_attr("global_symbol", tvm.runtime.String("myadd"))
     mod = tvm.IRModule.from_expr(f)
     f = tvm.tir.transform.MakePackedAPI(num_unpacked_args)(mod)["main"]
     assert(len(f.params) == 7)