[REFACTOR] Establish tir (#4740)
authorTianqi Chen <tqchen@users.noreply.github.com>
Sun, 19 Jan 2020 06:44:50 +0000 (22:44 -0800)
committerGitHub <noreply@github.com>
Sun, 19 Jan 2020 06:44:50 +0000 (22:44 -0800)
commitcf59b206b80bc80db51ae670f64315ef96043780
tree6f265f815bf3adc25643137c14417494c4d91247
parent7e3920198cb48cc9f5361cefc2253f656c0c6d5a
[REFACTOR] Establish tir (#4740)

TIR is the new namespace for low-level IR
for tensor-level optimizations and loop transformations.

This PR establishes the namespace and files.

- lowered_func.h,buffer.h,data_layout.h -> tir/buffer.h,tir/data_layout.h,tir/lowered_func.h
- ir.h -> tir/expr.h, tir/stmt.h
- ir_functor_ext.h -> tir/expr_functor.h, tir/stmt_functor.h
267 files changed:
CMakeLists.txt
apps/extension/src/tvm_ext.cc
apps/lldb/tvm.py
include/tvm/arith/analyzer.h
include/tvm/arith/bound.h
include/tvm/arith/int_set.h
include/tvm/arith/pattern.h
include/tvm/build_module.h
include/tvm/codegen.h
include/tvm/expr.h [deleted file]
include/tvm/ir/expr.h
include/tvm/node/printer.h
include/tvm/relay/base.h
include/tvm/relay/op_attr_types.h
include/tvm/relay/type.h
include/tvm/tir/buffer.h [moved from include/tvm/buffer.h with 96% similarity]
include/tvm/tir/data_layout.h [moved from include/tvm/data_layout.h with 96% similarity]
include/tvm/tir/expr.h [moved from include/tvm/ir.h with 57% similarity]
include/tvm/tir/expr_functor.h [new file with mode: 0644]
include/tvm/tir/ir_pass.h [moved from include/tvm/ir_pass.h with 98% similarity]
include/tvm/tir/lowered_func.h [moved from include/tvm/lowered_func.h with 91% similarity]
include/tvm/tir/op.h [moved from include/tvm/expr_operator.h with 88% similarity]
include/tvm/tir/stmt.h [new file with mode: 0644]
include/tvm/tir/stmt_functor.h [moved from include/tvm/ir_functor_ext.h with 52% similarity]
include/tvm/top/operation.h
include/tvm/top/schedule.h
include/tvm/top/tensor.h
include/tvm/top/tensor_intrin.h
python/tvm/ir_pass.py
src/README.md
src/api/api_arith.cc
src/api/api_base.cc
src/api/api_codegen.cc
src/api/api_ir.cc
src/api/api_lang.cc
src/api/api_pass.cc
src/api/api_schedule.cc
src/api/api_test.cc
src/arith/analyzer.cc
src/arith/bound_deducer.cc
src/arith/canonical_simplify.cc
src/arith/compute_expr.h
src/arith/const_fold.h
src/arith/const_int_bound.cc
src/arith/detect_linear_equation.cc
src/arith/domain_touched.cc
src/arith/int_operator.h
src/arith/int_set.cc
src/arith/interval_set.h
src/arith/ir_mutator_with_analyzer.cc
src/arith/ir_mutator_with_analyzer.h
src/arith/ir_visitor_with_analyzer.h
src/arith/modular_set.cc
src/arith/pattern_match.h
src/arith/rewrite_simplify.cc
src/arith/rewrite_simplify.h
src/arith/stmt_simplify.cc
src/autotvm/feature_visitor.cc
src/autotvm/feature_visitor.h
src/autotvm/touch_extractor.h
src/codegen/build_common.h
src/codegen/build_module.cc
src/codegen/codegen.cc
src/codegen/codegen_c.cc
src/codegen/codegen_c.h
src/codegen/codegen_c_host.h
src/codegen/codegen_cuda.cc
src/codegen/codegen_cuda.h
src/codegen/codegen_source_base.cc
src/codegen/codegen_source_base.h
src/codegen/codegen_vhls.h
src/codegen/intrin_rule.cc
src/codegen/intrin_rule.h
src/codegen/llvm/codegen_amdgpu.cc
src/codegen/llvm/codegen_arm.cc
src/codegen/llvm/codegen_cpu.cc
src/codegen/llvm/codegen_llvm.cc
src/codegen/llvm/codegen_llvm.h
src/codegen/llvm/codegen_nvptx.cc
src/codegen/llvm/codegen_x86_64.cc
src/codegen/llvm/intrin_rule_llvm.cc
src/codegen/llvm/intrin_rule_llvm.h
src/codegen/llvm/intrin_rule_nvptx.cc
src/codegen/llvm/intrin_rule_rocm.cc
src/codegen/spirv/build_vulkan.cc
src/codegen/spirv/codegen_spirv.cc
src/codegen/spirv/codegen_spirv.h
src/codegen/spirv/intrin_rule_spirv.cc
src/codegen/spirv/ir_builder.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/ir/attr_functor.h
src/ir/attrs.cc
src/ir/env_func.cc
src/ir/expr.cc
src/ir/transform.cc
src/lang/expr.cc [deleted file]
src/node/printer.cc
src/relay/backend/build_module.cc
src/relay/backend/compile_engine.cc
src/relay/backend/compile_engine.h
src/relay/backend/contrib/codegen_c/codegen_c.h
src/relay/backend/graph_plan_memory.cc
src/relay/backend/graph_runtime_codegen.cc
src/relay/backend/interpreter.cc
src/relay/backend/param_dict.h
src/relay/backend/utils.h
src/relay/backend/vm/compiler.cc
src/relay/backend/vm/compiler.h
src/relay/backend/vm/lambda_lift.cc
src/relay/backend/vm/removed_unused_funcs.cc
src/relay/ir/alpha_equal.cc
src/relay/ir/expr.cc
src/relay/ir/hash.cc
src/relay/ir/pretty_printer.cc
src/relay/ir/transform.cc
src/relay/ir/type.cc
src/relay/op/annotation/annotation.cc
src/relay/op/debug.cc
src/relay/op/device_copy.cc
src/relay/op/image/resize.cc
src/relay/op/nn/bitserial.cc
src/relay/op/nn/convolution.cc
src/relay/op/nn/convolution.h
src/relay/op/nn/nn.cc
src/relay/op/nn/pad.cc
src/relay/op/nn/pooling.cc
src/relay/op/nn/sparse.cc
src/relay/op/nn/upsampling.cc
src/relay/op/tensor/reduce.cc
src/relay/op/tensor/transform.cc
src/relay/op/type_relations.cc
src/relay/op/vision/multibox_op.cc
src/relay/pass/alter_op_layout.cc
src/relay/pass/canonicalize_cast.cc
src/relay/pass/canonicalize_ops.cc
src/relay/pass/combine_parallel_conv2d.cc
src/relay/pass/combine_parallel_dense.cc
src/relay/pass/combine_parallel_op_batch.cc
src/relay/pass/convert_layout.cc
src/relay/pass/device_annotation.cc
src/relay/pass/eliminate_common_subexpr.cc
src/relay/pass/fold_constant.cc
src/relay/pass/fold_scale_axis.cc
src/relay/pass/fuse_ops.cc
src/relay/pass/gradient.cc
src/relay/pass/infer_layout_util.h
src/relay/pass/legalize.cc
src/relay/pass/mac_count.cc
src/relay/pass/partition_graph.cc
src/relay/pass/pattern_util.h
src/relay/pass/simplify_inference.cc
src/relay/pass/transform_layout.h
src/relay/pass/type_solver.cc
src/relay/qnn/op/concatenate.cc
src/relay/qnn/op/convolution.cc
src/relay/qnn/util.h
src/target/target.cc
src/tir/ir/buffer.cc [moved from src/lang/buffer.cc with 92% similarity]
src/tir/ir/data_layout.cc [moved from src/lang/data_layout.cc with 94% similarity]
src/tir/ir/expr.cc [moved from src/lang/ir.cc with 52% similarity]
src/tir/ir/expr_functor.cc [new file with mode: 0644]
src/tir/ir/functor_common.h [new file with mode: 0644]
src/tir/ir/lowered_func.cc [moved from src/lang/lowered_func.cc with 94% similarity]
src/tir/ir/op.cc [moved from src/lang/expr_operator.cc with 71% similarity]
src/tir/ir/stmt.cc [new file with mode: 0644]
src/tir/ir/stmt_functor.cc [moved from src/pass/ir_functor.cc with 60% similarity]
src/tir/pass/arg_binder.cc [moved from src/pass/arg_binder.cc with 96% similarity]
src/tir/pass/arg_binder.h [moved from src/pass/arg_binder.h with 96% similarity]
src/tir/pass/bound_checker.cc [moved from src/pass/bound_checker.cc with 96% similarity]
src/tir/pass/combine_context_call.cc [moved from src/pass/combine_context_call.cc with 95% similarity]
src/tir/pass/coproc_sync.cc [moved from src/pass/coproc_sync.cc with 99% similarity]
src/tir/pass/detect_device.cc [moved from src/pass/detect_device.cc with 88% similarity]
src/tir/pass/hoist_if_then_else.cc [moved from src/pass/hoist_if_then_else.cc with 98% similarity]
src/tir/pass/infer_fragment.cc [moved from src/pass/infer_fragment.cc with 97% similarity]
src/tir/pass/inject_copy_intrin.cc [moved from src/pass/inject_copy_intrin.cc with 97% similarity]
src/tir/pass/inject_double_buffer.cc [moved from src/pass/inject_double_buffer.cc with 98% similarity]
src/tir/pass/inject_prefetch.cc [moved from src/pass/inject_prefetch.cc with 95% similarity]
src/tir/pass/inject_virtual_thread.cc [moved from src/pass/inject_virtual_thread.cc with 98% similarity]
src/tir/pass/inline.cc [moved from src/pass/inline.cc with 94% similarity]
src/tir/pass/ir_deep_compare.cc [moved from src/pass/ir_deep_compare.cc with 99% similarity]
src/tir/pass/ir_util.cc [moved from src/pass/ir_util.cc with 98% similarity]
src/tir/pass/ir_util.h [moved from src/pass/ir_util.h with 96% similarity]
src/tir/pass/lift_attr_scope.cc [moved from src/pass/lift_attr_scope.cc with 98% similarity]
src/tir/pass/loop_partition.cc [moved from src/pass/loop_partition.cc with 98% similarity]
src/tir/pass/lower_custom_datatypes.cc [moved from src/pass/lower_custom_datatypes.cc with 97% similarity]
src/tir/pass/lower_intrin.cc [moved from src/pass/lower_intrin.cc with 95% similarity]
src/tir/pass/lower_thread_allreduce.cc [moved from src/pass/lower_thread_allreduce.cc with 97% similarity]
src/tir/pass/lower_tvm_builtin.cc [moved from src/pass/lower_tvm_builtin.cc with 98% similarity]
src/tir/pass/lower_warp_memory.cc [moved from src/pass/lower_warp_memory.cc with 98% similarity]
src/tir/pass/make_api.cc [moved from src/pass/make_api.cc with 98% similarity]
src/tir/pass/remap_thread_axis.cc [moved from src/pass/remap_thread_axis.cc with 95% similarity]
src/tir/pass/remove_no_op.cc [moved from src/pass/remove_no_op.cc with 97% similarity]
src/tir/pass/rewrite_unsafe_select.cc [moved from src/pass/rewrite_unsafe_select.cc with 97% similarity]
src/tir/pass/simple_passes.cc [moved from src/pass/simple_passes.cc with 96% similarity]
src/tir/pass/skip_assert.cc [moved from src/pass/skip_assert.cc with 91% similarity]
src/tir/pass/split_host_device.cc [moved from src/pass/split_host_device.cc with 97% similarity]
src/tir/pass/ssa.cc [moved from src/pass/ssa.cc with 98% similarity]
src/tir/pass/storage_access.cc [moved from src/pass/storage_access.cc with 98% similarity]
src/tir/pass/storage_access.h [moved from src/pass/storage_access.h with 94% similarity]
src/tir/pass/storage_flatten.cc [moved from src/pass/storage_flatten.cc with 97% similarity]
src/tir/pass/storage_rewrite.cc [moved from src/pass/storage_rewrite.cc with 99% similarity]
src/tir/pass/storage_sync.cc [moved from src/pass/storage_sync.cc with 98% similarity]
src/tir/pass/tensor_core.cc [moved from src/pass/tensor_core.cc with 98% similarity]
src/tir/pass/unroll_loop.cc [moved from src/pass/unroll_loop.cc with 96% similarity]
src/tir/pass/vectorize_loop.cc [moved from src/pass/vectorize_loop.cc with 99% similarity]
src/tir/pass/verify_compact_buffer.cc [moved from src/pass/verify_compact_buffer.cc with 90% similarity]
src/tir/pass/verify_gpu_code.cc [moved from src/pass/verify_gpu_code.cc with 93% similarity]
src/tir/pass/verify_memory.cc [moved from src/pass/verify_memory.cc with 98% similarity]
src/top/operation/compute_op.cc
src/top/operation/compute_op.h
src/top/operation/cross_thread_reduction.cc
src/top/operation/extern_op.cc
src/top/operation/hybrid_op.cc
src/top/operation/hybrid_op.h
src/top/operation/op_util.cc
src/top/operation/op_util.h
src/top/operation/scan_op.cc
src/top/operation/tensor_compute_op.cc
src/top/operation/tensorize.cc
src/top/schedule/auto_inline_elem_wise.cc
src/top/schedule/bound.cc
src/top/schedule/graph.cc
src/top/schedule/graph.h
src/top/schedule/message_passing.cc
src/top/schedule/message_passing.h
src/top/schedule/schedule_dataflow_rewrite.cc
src/top/schedule/schedule_lang.cc
src/top/schedule/schedule_ops.cc
src/top/tensor.cc
tests/cpp/attrs_test.cc
tests/cpp/container_test.cc
tests/cpp/expr_test.cc
tests/cpp/ir_functor_test.cc
tests/cpp/ir_simplify_test.cc
tests/cpp/ir_ssa_test.cc
tests/cpp/packed_func_test.cc
tests/cpp/pattern_match_test.cc
tests/cpp/simple_passes_test.cc
topi/include/topi/broadcast.h
topi/include/topi/cuda/dense.h
topi/include/topi/cuda/normalization.h
topi/include/topi/cuda/pooling.h
topi/include/topi/cuda/reduction.h
topi/include/topi/cuda/softmax.h
topi/include/topi/detail/broadcast.h
topi/include/topi/detail/constant_utils.h
topi/include/topi/detail/extern.h
topi/include/topi/detail/pad_utils.h
topi/include/topi/detail/ravel_unravel.h
topi/include/topi/elemwise.h
topi/include/topi/image/resize.h
topi/include/topi/nn.h
topi/include/topi/nn/batch_matmul.h
topi/include/topi/nn/bias_add.h
topi/include/topi/nn/bnn.h
topi/include/topi/nn/dense.h
topi/include/topi/nn/dilate.h
topi/include/topi/nn/flatten.h
topi/include/topi/nn/local_response_norm.h
topi/include/topi/nn/pooling.h
topi/include/topi/nn/softmax.h
topi/include/topi/reduction.h
topi/include/topi/transform.h
topi/include/topi/vision/reorg.h