circt/test/circt-reduce
Fabian Schuiki cacbaf7210
[reduce] Add a first proof-of-concept reducer implementation with sample FIRRTL dialect reducers (#1591)
- Update/rewrite the `circt-reduce` tool with a custom proof-of-concept
  reducer for the FIRRTL dialect. This is supposed to be a pathfinding
  exercise and just uses FIRRTL as an example. The intent is for other
  dialects to be able to produce sets of their own reducers that will
  then be combined by the tool to operate on some input IR.

  At this point, `circt-reduce` can be used to reduce FIRRTL test cases by
  converting as many `firrtl.module` ops into `firrtl.extmodule` ops as
  possible while still maintaining some interesting characteristic.

- Extend `circt-reduce` to support exploratively applying passes to the
  input in an effort to reduce its size. Also add the ability to specify
  an entire list of potential reduction strategies/patterns which are
  tried in order. This allows for reductions with big effect, like
  removing entire modules, to be tried first, before taking a closer
  look at individual instructions.

- Add reduction strategies to `circt-reduce` that try to replace the
  right hand side of FIRRTL connects with `invalidvalue`, and generally 
  try to remove operations if they have no results or no users of their 
  results.

- Add a reduction pattern to `circt-reduce` that replaces instances of
  `firrtl.extmodule` with a `firrtl.wire` for each port. This can
  significantly reduce the complexity of test cases by pruning the
  module hierarchy of unused modules.

- Move the `Reduction` class and sample implementations into a separate
  header and implementation file. These currently live in
  `tools/circt-reduce`, but should later move into a dedicated reduction
  framework, maybe in `include/circt/Reduce`, where dialects can easily
  access them and provide their own reduction implementations.
2021-08-18 17:22:43 +02:00
..
commandline.mlir [reduce] Add a first proof-of-concept reducer implementation with sample FIRRTL dialect reducers (#1591) 2021-08-18 17:22:43 +02:00
trivial.mlir [reduce] Add a first proof-of-concept reducer implementation with sample FIRRTL dialect reducers (#1591) 2021-08-18 17:22:43 +02:00
trivial.sh [reduce] Add a first proof-of-concept reducer implementation with sample FIRRTL dialect reducers (#1591) 2021-08-18 17:22:43 +02:00