Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This change consists of a couple improvements to the deduplication pass, the first two of which increase performance. 1. Adds an NLA Cache, which maps a namepath attribute to an HierPathOp which matches. Dedup uses this to reuse HierPathOps in the circuit instead of creating new ones. This used to cause problem by passes which assumed ops did not share NLAs. This has an added effect of doing some HierPathOp garbage collection when we delete a module. 2. The targetMap, which maps an NLA to the operations which use it, now uses an SmallDenseSet. The original logic could end up recording the same target multiple times. AnnoTarget was made hashable for this. 3. Annotation merging used to merge identical annotations, now it keeps both annotations and makes them non-local. The original behaviour is kept for only DontTouch annotations, where it will only keep one. 4. When a module is merged into another, the original modules annotations are now first instead of second in the annotation list. 5. Some simplification of functions, especially unused argument removal, and creating functions for common code.
- Loading branch information