Closed dtzSiFive closed 1 week ago
I think there are a couple of places that have this code inlined, as not doing this attaches an empty annotation attribute which I usually only catch when I am writing tests. e.g. very recently: https://github.com/llvm/circt/blob/main/lib/Dialect/FIRRTL/Transforms/SpecializeLayers.cpp#L66
I think I misunderstood what this code is doing - just creating an empty annotation set creates an empty array attribute, and that is what we're trying to avoid? 🤦
Common pattern of walk/visit many operations looking for annotations and removing along the way is taking considerable amount of time in ArrayAttr::get. Optimize the fast path for operations having no annotations.