EPFL-LAP / dynamatic

DHLS (Dynamic High-Level Synthesis) compiler based on MLIR
Other
58 stars 15 forks source link

[Handshake] Branch Canonicalization #152

Open kb29x37 opened 1 week ago

kb29x37 commented 1 week ago

Sometimes, both Branch outputs connect to the same CMerge / same Multiplexer. In such cases, the Branch and the component it connects to can be removed.

For example, in the binary_search benchmark, the situation occurs between cond_br19 and control_merge6, cond_br15 and mux17, cond_br2 and mux23, etc.

See the example attached.

image binary_search.txt

Jiahui17 commented 1 week ago

Maybe we put this in #148?

lucas-rami commented 1 week ago

I think these should be separate; the other one can be completed independently of this one (even if I mention over there that we should think of new optimizations it is mostly focused on the mechanical refactoring of the canonicalization patterns). I also made the other one as a "good first issue" so I would like to keep it simple if possible.

AyaElAkhras commented 1 week ago

Such situations and more are systematically tackled by a set of transformations packaged in a term rewriting system that I'm currently working on.