Consider the following:
module {
firrtl.circuit "Foo" {
firrtl.layer @A bind attributes {output_file = #hw.output_file<"a/">, sym_visibility = "private"} {
firrtl.layer @B bind attributes {output_file = #hw.output_file<"a/b/">} {
}
firrtl.layer @C bind attributes {output_file = #hw.output_file<"a/c/">} {
}
}
firrtl.module @Foo() attributes {layers = [@A, @A::@B, @A::@C]} {
}
}
}
When run through circt-reduce, this could remove the layer enables, but it doesn't:
# circt-reduce -test /usr/bin/grep -test-arg '@Foo' reduced.1.mlir
All reduction strategies exhausted
Final size: 402 (0% reduction)
module {
firrtl.circuit "Foo" {
firrtl.layer @A bind attributes {output_file = #hw.output_file<"a/">, sym_visibility = "private"} {
firrtl.layer @B bind attributes {output_file = #hw.output_file<"a/b/">} {
}
firrtl.layer @C bind attributes {output_file = #hw.output_file<"a/c/">} {
}
}
firrtl.module @Foo() attributes {layers = [@A, @A::@B, @A::@C]} {
}
}
}
There already exists a LayerDisable reduction, but this doesn't apply to layer enables. Extend this (or add a new reduction) that removes this so the final output is:
module {
firrtl.circuit "Foo" {
firrtl.module @Foo() {
}
}
}
Consider the following:
When run through
circt-reduce, this could remove the layer enables, but it doesn't:There already exists a
LayerDisablereduction, but this doesn't apply to layer enables. Extend this (or add a new reduction) that removes this so the final output is: