Add support for nested symbol references.
authorRiver Riddle <riverriddle@google.com>
Tue, 12 Nov 2019 02:18:02 +0000 (18:18 -0800)
committerA. Unique TensorFlower <gardener@tensorflow.org>
Tue, 12 Nov 2019 02:18:31 +0000 (18:18 -0800)
commit9b9c647cefea0a81fdf7d2bf6586a13f99d9a2cf
tree2fd6e7aeaa1e41a5e5a6355f860f35bc63ca8d99
parent5cf6e0ce7f03f9841675b1a9d44232540f3df5cc
Add support for nested symbol references.

This change allows for adding additional nested references to a SymbolRefAttr to allow for further resolving a symbol if that symbol also defines a SymbolTable. If a referenced symbol also defines a symbol table, a nested reference can be used to refer to a symbol within that table. Nested references are printed after the main reference in the following form:

  symbol-ref-attribute ::= symbol-ref-id (`::` symbol-ref-id)*

Example:

  module @reference {
    func @nested_reference()
  }

  my_reference_op @reference::@nested_reference

Given that SymbolRefAttr is now more general, the existing functionality centered around a single reference is moved to a derived class FlatSymbolRefAttr. Followup commits will add support to lookups, rauw, etc. for scoped references.

PiperOrigin-RevId: 279860501
38 files changed:
mlir/examples/toy/Ch2/include/toy/Ops.td
mlir/examples/toy/Ch3/include/toy/Ops.td
mlir/examples/toy/Ch4/include/toy/Ops.td
mlir/examples/toy/Ch5/include/toy/Ops.td
mlir/examples/toy/Ch6/include/toy/Ops.td
mlir/examples/toy/Ch6/mlir/LowerToLLVM.cpp
mlir/examples/toy/Ch7/include/toy/Ops.td
mlir/examples/toy/Ch7/mlir/LowerToLLVM.cpp
mlir/g3doc/LangRef.md
mlir/g3doc/Tutorials/Toy/Ch-6.md
mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td
mlir/include/mlir/Dialect/Linalg/IR/LinalgLibraryOps.td
mlir/include/mlir/Dialect/SPIRV/SPIRVControlFlowOps.td
mlir/include/mlir/Dialect/SPIRV/SPIRVOps.td
mlir/include/mlir/Dialect/SPIRV/SPIRVStructureOps.td
mlir/include/mlir/Dialect/StandardOps/Ops.td
mlir/include/mlir/IR/Attributes.h
mlir/include/mlir/IR/Builders.h
mlir/include/mlir/IR/Function.h
mlir/include/mlir/IR/OpBase.td
mlir/lib/Analysis/CallGraph.cpp
mlir/lib/Dialect/GPU/IR/GPUDialect.cpp
mlir/lib/Dialect/GPU/Transforms/KernelOutlining.cpp
mlir/lib/Dialect/Linalg/Transforms/LowerToLLVMDialect.cpp
mlir/lib/Dialect/SPIRV/SPIRVOps.cpp
mlir/lib/Dialect/SPIRV/Serialization/Deserializer.cpp
mlir/lib/Dialect/SPIRV/Serialization/Serializer.cpp
mlir/lib/Dialect/StandardOps/Ops.cpp
mlir/lib/IR/AsmPrinter.cpp
mlir/lib/IR/AttributeDetail.h
mlir/lib/IR/Attributes.cpp
mlir/lib/IR/Builders.cpp
mlir/lib/IR/FunctionSupport.cpp
mlir/lib/Parser/Parser.cpp
mlir/lib/Target/LLVMIR/ModuleTranslation.cpp
mlir/test/IR/parser.mlir
mlir/test/lib/TestDialect/TestOps.td
mlir/test/mlir-tblgen/op-attribute.td