[REFACTOR][IR] Introduce SeqStmt to replace ir::Block (#4627)
authorTianqi Chen <tqchen@users.noreply.github.com>
Mon, 6 Jan 2020 05:39:33 +0000 (21:39 -0800)
committerGitHub <noreply@github.com>
Mon, 6 Jan 2020 05:39:33 +0000 (21:39 -0800)
commit3595cbe02cc813e400357e30161249dc43f7f05d
treec543a4cf9765c56bb77118d6e7ee4252e03e2866
parent34b98eb7049d4d69ef61e4fb4bce51cbccd3a207
[REFACTOR][IR] Introduce SeqStmt to replace ir::Block (#4627)

* [REFACTOR][IR] Introduce SeqStmt to replace Block

ir::Block was used to represent a sequence of Stmts in the original low-level IR.
The nested ir::Block structure is not really friendly for recursive visits,
especially when the statements are unrolled.

This PR introduce a SeqStmt that directly stores a sequence of statements in an Array container.
The new SeqStmt will be used as a replacement of the original Block structure.

* [REFACTOR] Migrate use of Block to SeqStmt.

* [REFACTOR] Remove Block

* Add more comments per yizhi's comment
55 files changed:
include/tvm/expr_operator.h
include/tvm/ir.h
include/tvm/ir_functor_ext.h
include/tvm/node/container.h
python/tvm/hybrid/parser.py
python/tvm/ir_builder.py
python/tvm/stmt.py
src/api/api_ir.cc
src/codegen/codegen_c.cc
src/codegen/codegen_c.h
src/codegen/llvm/codegen_llvm.cc
src/codegen/llvm/codegen_llvm.h
src/codegen/spirv/codegen_spirv.cc
src/codegen/spirv/codegen_spirv.h
src/codegen/stackvm/codegen_stackvm.cc
src/codegen/stackvm/codegen_stackvm.h
src/contrib/hybrid/codegen_hybrid.cc
src/contrib/hybrid/codegen_hybrid.h
src/lang/ir.cc
src/op/compute_op.cc
src/op/cross_thread_reduction.cc
src/op/tensor_compute_op.cc
src/op/tensorize.cc
src/pass/arg_binder.cc
src/pass/coproc_sync.cc
src/pass/inject_double_buffer.cc
src/pass/inject_prefetch.cc
src/pass/inject_virtual_thread.cc
src/pass/ir_deep_compare.cc
src/pass/ir_functor.cc
src/pass/ir_util.cc
src/pass/ir_util.h
src/pass/lift_attr_scope.cc
src/pass/loop_partition.cc
src/pass/lower_thread_allreduce.cc
src/pass/lower_tvm_builtin.cc
src/pass/make_api.cc
src/pass/remove_no_op.cc
src/pass/storage_sync.cc
src/pass/unroll_loop.cc
src/schedule/schedule_ops.cc
tests/cpp/ir_functor_test.cc
tests/python/unittest/test_hybrid_script.py
tests/python/unittest/test_ir_builder.py
tests/python/unittest/test_lang_constructor.py
tests/python/unittest/test_lang_tensor.py
tests/python/unittest/test_pass_equal.py
tests/python/unittest/test_pass_inject_vthread.py
tests/python/unittest/test_pass_lift_attr_scope.py
tests/python/unittest/test_pass_loop_partition.py
tests/python/unittest/test_pass_remove_no_op.py
tests/python/unittest/test_pass_storage_sync.py
tests/python/unittest/test_pass_unroll.py
tests/python/unittest/test_schedule_schedule_ops.py
vta/python/vta/ir_pass.py