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.
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.