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:
- Modifying the
.inc
- Writing default visitor and printer.