cornell-zhang / heterocl

HeteroCL: A Multi-Paradigm Programming Infrastructure for Software-Defined Heterogeneous Computing
https://cornell-zhang.github.io/heterocl/
Apache License 2.0
322 stars 92 forks source link

[Pass] Introduce new IR node: MultiBlock #322

Closed seanlatias closed 3 years ago

seanlatias commented 3 years ago

With this PR, a new IR node is introduced. This PR does not modify any existing logic.

The goal of introducing this node is to solve the potential stack-overflow problem. With the current Halide node Block, since it only has two body statements, to create a serial of N consecutive statements, we will generate an IR tree of depth N-1. To solve that, a new IR node, MultiBlock, is introduced. Instead of building it as a deep tree, this node allows users to create a wide tree with an array of statements. In the future, we should try to replace Block with MultiBlock as much as possible.