From 58ae2dcf39628301db571a379b4e25b215baabef Mon Sep 17 00:00:00 2001 From: Prithayan Barua Date: Fri, 13 Dec 2024 07:22:22 -0800 Subject: [PATCH] [InstanceChoice] Move specialize options pass earlier in the firtool pipeline --- lib/Firtool/Firtool.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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.