diff --git a/lib/Firtool/Firtool.cpp b/lib/Firtool/Firtool.cpp index 4aa85db1b08d..3ea6e782f7d5 100644 --- a/lib/Firtool/Firtool.cpp +++ b/lib/Firtool/Firtool.cpp @@ -55,6 +55,10 @@ LogicalResult firtool::populatePreprocessTransforms(mlir::PassManager &pm, LogicalResult firtool::populateCHIRRTLToLowFIRRTL(mlir::PassManager &pm, const FirtoolOptions &opt, StringRef inputFilename) { + // TODO: Ensure instance graph and other passes can handle instance choice + // then run this pass after all diagnostic passes have run. + pm.addNestedPass(firrtl::createSpecializeOptionPass( + opt.shouldSelectDefaultInstanceChoice())); pm.nest().addPass(firrtl::createLowerSignaturesPass()); pm.nest().addPass(firrtl::createInjectDUTHierarchyPass()); @@ -131,10 +135,8 @@ LogicalResult firtool::populateCHIRRTLToLowFIRRTL(mlir::PassManager &pm, pm.addNestedPass(firrtl::createCheckCombLoopsPass()); - // Must run the specialize instance-choice and layers passes after all - // diagnostic passes have run, otherwise it can hide errors. - pm.addNestedPass(firrtl::createSpecializeOptionPass( - opt.shouldSelectDefaultInstanceChoice())); + // Must run this pass after all diagnostic passes have run, otherwise it can + // hide errors. pm.addNestedPass(firrtl::createSpecializeLayersPass()); // Run after inference, layer specialization.