llvm / circt

Circuit IR Compilers and Tools
https://circt.org
Other
1.64k stars 285 forks source link

[firtool] Move SpecializeLayers before LowerLayers #7201

Closed youngar closed 3 months ago

youngar commented 3 months ago

We can't specialize away layers after they are lowered, so this pass was placed in the wrong spot in the pipeline. It was a last minute change to move specialize layers after checking for combinational loops which caused this bug, as we need to make sure that all diagnostic passes run before we start deleting logic, otherwise we can hide errors from the user. This adds a few tests that layer specialization is working as intended, and that it doesn't prevent detection of errors.