-
Notifications
You must be signed in to change notification settings - Fork 373
Description
The InstanceGraph
implements llvm::GraphTraits
. That uses getTopLevelNode()
as the root node of the graph, which does not contain all modules in the instance graph. Instead, the behaviour is dependent on concrete subclasses of the instance graph. The HW and FIRRTL dialects define this to be variants of "the top module" and "all public modules", which is usually not what we want in a pass. A pass is more likely to want to visit all modules in the IR in post order (children before parents), not just a subset of the modules depending on whether things are transitively instantiated. The new walkPostOrder
or walkInversePostOrder
functions on InstanceGraph
implement those walks.
It may be useful to mark at least getTopLevelNode()
on the graph traits deprecated, with a comment about moving to the new walk functions. We shouldn't have any warnings in the code base after this. Only make this change if we have a valid alternative for all existing uses.