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
{{ message }}
Repository navigation
perf(native): task deduplication compares whole execution units for every trigger #1982
The native backend spends most of a large design's compile time comparing execution units for task deduplication.
On rtlmeter C906 (integration build of master feba1a5 + #1954 + #1950, release, --two-state), a 4000-cycle probe ran for 19+ minutes without reaching the first testbench output. A 15 s perf record of the process showed:
__memcmp_evex_movbe
54.8%
HashMap<BlockId, BasicBlock>PartialEq::eq
35.7%
backend::native::backend::compile_program
6.8%
SIRTerminatorPartialEq::eq
2.7%
collect_comb_apply_compile_tasks and collect_ff_compile_tasks_from (crates/celox/src/backend/native/backend.rs) find an existing task for each trigger with tasks.iter().position(|task| task.units == unit_refs). unit_refs is a Vec<&ExecutionUnit>, so == compares the units deeply, block by block. In the unfused comb-apply case every task starts with all of eval_comb, so each comparison walks the whole combinational program, and the linear search makes it O(triggers² × program size).
Expected
Deduplication cost proportional to the number of triggers (for example, compare unit identity first or key tasks by a hash), with the same set of compiled tasks and bindings as today. Generated code must not change.
Activity
perf(native): deduplicate compile tasks by unit classes instead of de…