[RFC] [A moderate code refactor] Managing HalideIR nodes in a .inc file


#1

LLVM manages many repeating codes in this way:

File nodes.inc:

MACRO(A)
MACRO(B)
...
MACRO(Someting)

File something.h

#define MACRO SOMETHING_USEFUL
#include "nodes.inc"
#undef MACRO

For now, if we want to add some HalideIR node, we have many places in the code base to modify to fit in the dispatch interface (and in the current TVM build system Shuffle node is totally missing).

I want to unify those places in a .inc file so that adding new node becomes as easy as:

  1. Modifying the .inc
  2. Writing default visitor and printer.

#2

This is somewhat related to https://github.com/dmlc/tvm/issues/3501