[FIRRTL][CheckCombLoops] Switch to the new pass checkCombLoops instead of checkCombCycles (#4513)

Switch to the new CheckCombLoops pass and add a flag
 `--use-old-check-comb-cycles` to switch to the old `CheckCombCycles` pass.
This commit is contained in:
Prithayan Barua 2023-01-09 20:57:37 -08:00 committed by GitHub
parent e6a9e3313a
commit 0cf02d2132
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 15 additions and 8 deletions

View File

@ -304,6 +304,11 @@ static cl::opt<bool>
cl::desc("Disable the CheckCombCycles pass"),
cl::init(false), cl::Hidden, cl::cat(mainCategory));
static cl::opt<bool> useOldCheckCombCycles(
"use-old-check-comb-cycles",
cl::desc("Use old CheckCombCycles pass, that does not support aggregates"),
cl::init(false), cl::Hidden, cl::cat(mainCategory));
static cl::opt<bool> disableIMDCE("disable-imdce",
cl::desc("Disable the IMDCE pass"),
cl::init(false), cl::Hidden,
@ -692,14 +697,16 @@ static LogicalResult processBuffer(
firrtl::createRandomizeRegisterInitPass());
if (!disableCheckCombCycles) {
// TODO: Currently CheckCombCyles pass doesn't support aggregates so skip
// the pass for now.
if (preserveAggregate == firrtl::PreserveAggregate::None)
pm.nest<firrtl::CircuitOp>().addPass(firrtl::createCheckCombCyclesPass());
else
emitWarning(module->getLoc())
<< "CheckCombCyclesPass doens't support aggregate "
"values yet so it is skipped\n";
if (useOldCheckCombCycles) {
if (preserveAggregate == firrtl::PreserveAggregate::None)
pm.nest<firrtl::CircuitOp>().addPass(
firrtl::createCheckCombCyclesPass());
else
emitWarning(module->getLoc())
<< "CheckCombCyclesPass doens't support aggregate "
"values yet so it is skipped\n";
} else
pm.nest<firrtl::CircuitOp>().addPass(firrtl::createCheckCombLoopsPass());
}
// If we parsed a FIRRTL file and have optimizations enabled, clean it up.