Traditional Program Analysis on TVM IR

Hi all,

Currently we are working on some passes on TVM IR level (the IR which once was Halide IR). They require some traditional program analysis (for example, Live Variable Analysis, Def-Use Information).

  1. We are wondering if there are any related infrastructure (like classic control-flow graph, basic block (A doubly-linked list-like structure)?

  2. If there is none, do you guys need one?

  3. We are also quite curious about how legality check is working. For example, if we try to use “compute_at” into a loop body, TVM will automatically resolve dependency issues. We are curious how it is resolved. Do you have any suggestion on the big picture and where in the source code we should look at?




Hi @tqchen ,

I am really curious about the current situation for the programmers who are working on TVM. Would you mind telling me if program analysis passes would be helpful for the programmers?

Thanks :slight_smile:

The Halide IR is in the form of ‘AST’ (i.e. tree form). This is quite different from conventional IR (e.g. LLVM) where stmts are sequentially linked. With the IRVisitor/Mutator pattern, one needs to implement extra book keeping in order to find out the ‘relative’ locations of the stmts. (should one decide to compute UD/DU chain) Would a sequence form representation of the IR be something useful to have?