llvm / llvm/circt

[FIRRTL] ExtractInstances duplicates NLAs without assigning new names

Open
#3,090 0 comments 0 reactions 0 assignees View on GitHub
bug FIRRTL
Dominant language
C++
Stars
2.2k
Forks
524
Avg merge
3d 2h
Merged PRs (30d)
46

Description

The following caveat is a problem: https://github.com/llvm/circt/blob/a9bdc67cf5bd9493b402c1ee18dca1f6c9766e28/lib/Dialect/FIRRTL/Transforms/ExtractInstances.cpp#L601-L620

In a nutshell: There are cases where `ExtractInstances` has to create multiple copies of an NLA during extraction, and currently it does not pick new names for those NLAs. Doing so is a bit cumbersome since the pass has to visit all instances along the NLA path and insert trackers for the newly-created NLAs there as well.

The case where this happens requires:
- An instance to be extracted that is nested somewhere within a multiply-instantiated module
- An NLA on that instance that is rooted at the multiply-instantiated module

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the caveat in lib/Dialect/FIRRTL/Transforms/ExtractInstances.cpp at lines 601-620 and examine how ExtractInstances handles NLAs during extraction. Reproduce the case involving an extracted instance nested in a multiply-instantiated module with an NLA rooted there. Done means duplicated NLAs receive new names and trackers are inserted along their instance paths.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.