Skip to content

Commit

Permalink
[firtool] Run CSE on classes (#7814)
Browse files Browse the repository at this point in the history
This runs CSE on all operations underneath the circuit. This also moves
it up before the rest of the FModule passes run, as the Any pipeline
will not merge with them.
  • Loading branch information
youngar authored Nov 14, 2024
1 parent 1f7b3ef commit f71d0fb
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions lib/Firtool/Firtool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,15 @@ LogicalResult firtool::populateCHIRRTLToLowFIRRTL(mlir::PassManager &pm,

pm.nest<firrtl::CircuitOp>().addPass(firrtl::createInjectDUTHierarchyPass());

if (!opt.shouldDisableOptimization())
pm.nest<firrtl::CircuitOp>().nestAny().addPass(mlir::createCSEPass());

pm.nest<firrtl::CircuitOp>().nest<firrtl::FModuleOp>().addPass(
firrtl::createPassiveWiresPass());

pm.nest<firrtl::CircuitOp>().nest<firrtl::FModuleOp>().addPass(
firrtl::createDropNamesPass(opt.getPreserveMode()));

if (!opt.shouldDisableOptimization())
pm.nest<firrtl::CircuitOp>().nest<firrtl::FModuleOp>().addPass(
mlir::createCSEPass());

pm.nest<firrtl::CircuitOp>().nest<firrtl::FModuleOp>().addPass(
firrtl::createLowerCHIRRTLPass());

Expand Down

0 comments on commit f71d0fb

Please sign in to comment.