Operations that only feed non-synthesizable ops (trace, assert, etc.) should be treated specially
Open
enhancement
ir
optimizer
scheduler
- Dominant language
- C++
- Stars
- 1.9k
- Forks
- 283
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 135
Description
Consider `if (f(x)) { fail!(...); () } else { () }`. If `f(x)` is big and expensive, it can impact scheduling of the rest of the circuit, but it is only used to feed a non-synthesizable `fail!()`.
Ideally, the compiler would factor out operations that only feed non-synthesizable ops. For example, in opt, if the only users of some MSBs are an assertion, opt should be free to narrow the operation (replicating the full-width version for the assertion). When scheduling, ops that only feed non-synthesizable ops should not be considered for any cost function. Ideally, any extra pipeline registers or other state should be guarded by `ifndef SYNTHESIS`.
Contributor guide
Assessment
This issue has not been assessed yet.