You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[FirRegLowering] Add limit to number of ifs generated (llvm#8313)
When lowering a firreg to SV, we structure the IR so that the register is
driven from inside an if-op tree. We build this structure by examining the
register's next value, translating mux ops into if-ops.
This PR sets a limit of 1024 on the number of if-ops generated for each
register. While it is unlikely to hit this limit in the common case, it is
possible to cause firtool to produce a very large if-op tree from a relatively
small number of mux ops. The goal is to prevent firtool from hanging.
If we exceed the limit, we stop translating muxes to nested if-ops, and just
drive the register with the original mux op result instead.
This PR changes the work stack to a work queue, so that we create if-ops in a
breadth-first order, so that the budget is allocated evenly across the branches
of the if-op tree.
0 commit comments