Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIRRTL] Move GC after AssignOutputDirs. #8112

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions lib/Firtool/Firtool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -185,13 +185,6 @@ LogicalResult firtool::populateCHIRRTLToLowFIRRTL(mlir::PassManager &pm,

pm.addNestedPass<firrtl::CircuitOp>(firrtl::createExtractInstancesPass());

// Run passes to resolve Grand Central features. This should run before
// BlackBoxReader because Grand Central needs to inform BlackBoxReader where
// certain black boxes should be placed. Note: all Grand Central Taps related
// collateral is resolved entirely by LowerAnnotations.
pm.addNestedPass<firrtl::CircuitOp>(
firrtl::createGrandCentralPass(opt.getCompanionMode()));

// Run SymbolDCE as late as possible, but before InnerSymbolDCE. This is for
// hierpathop's and just for general cleanup.
pm.addNestedPass<firrtl::CircuitOp>(mlir::createSymbolDCEPass());
Expand Down Expand Up @@ -250,6 +243,15 @@ LogicalResult firtool::populateCHIRRTLToLowFIRRTL(mlir::PassManager &pm,
pm.nest<firrtl::CircuitOp>().addPass(
firrtl::createAssignOutputDirsPass(outputFilename));

// Run passes to resolve Grand Central features. This should run before
// BlackBoxReader because Grand Central needs to inform BlackBoxReader where
// certain black boxes should be placed. Note: all Grand Central Taps related
// collateral is resolved entirely by LowerAnnotations.
// Run this after output directories are (otherwise) assigned,
// so generated interfaces can be appropriately marked.
pm.addNestedPass<firrtl::CircuitOp>(
firrtl::createGrandCentralPass(opt.getCompanionMode()));

// Read black box source files into the IR.
StringRef blackBoxRoot = opt.getBlackBoxRootPath().empty()
? llvm::sys::path::parent_path(inputFilename)
Expand Down
Loading