Closed teqdruid closed 2 years ago
You can implement SymbolUserOpInterface
to make this faster. See FIRRTL's instance op for an example:
https://github.com/llvm/circt/blob/main/lib/Dialect/FIRRTL/FIRRTLOps.cpp#L1294
There is a small issue here where the Op verification order verifies parent ops first and this means that the parent SymbolTable op will call this function before the normal InstanceOp verifiers are run. There is some discussion about this on discourse which I will try to find.
Thanks @youngar! That seemed to work (see my PR).
The internal application on which I'm working contains 1800 global refs. This results in
GlobalRefOp::verify()
being 64% of the runtime. Drilling in further: each time the verifier runs (1800 times per IR verify), it builds a newSymbolTable
which shows as the vast majority of time inverify()
.https://github.com/llvm/circt/blob/31205ddd090313e73e2b10462d424c1a56ca9545/lib/Dialect/HW/HWOps.cpp#L1460
What's the right way to share the
SymbolTable
across all the 1800GlobalRefOp::verify()
invocations in a verification pass?