LLZK 0.1.0
Veridise's ZK Language IR
|
This is a selection of code from mlir/lib/IR/SymbolTable.cpp
to support a modified version of walkSymbolRefs()
so the "symbol use" functions will also consider symbols used within the operand and result types of Ops.
More...
Go to the source code of this file.
This is a selection of code from mlir/lib/IR/SymbolTable.cpp
to support a modified version of walkSymbolRefs()
so the "symbol use" functions will also consider symbols used within the operand and result types of Ops.
The problem is that walkSymbolRefs()
only searches op->getAttrDictionary()
which does not include any Type instances used on the operand and result SSA values but in LLZK, the StructType can contain symbol references so they should be included in the results here. Only walkSymbolRefs()
and getSymbolName()
are functionally modified from their MLIR versions.
An alternative solution that could be explored further is adding an additional kind of Attribute on all ops that ensures the operand and result Type instances are included in the walk. However, that approach is not straightforward to implement. When would these be added? How would they be kept in sync with the actual Values? MLIR allows mutable attributes/types but it doesn't seem like the walk would pick up whatever's included in the mutable part of the underlying storage because that part cannot be included in the storage KeyTy
and IIUC, the walk recursion is based on the KeyTy
.
Definition in file SymbolTableLLZK.cpp.