This document provides insight on the rationale and the design of Symbols in MLIR, and why they are necessary.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
@mehdi_amini Coming back to this after a while, let me know if I'm missing anything or if there is something you want discussed.
Unit tests: pass. 62196 tests passed, 0 failed and 815 were skipped.
clang-tidy: pass.
clang-format: pass.
Build artifacts: diff.json, clang-tidy.txt, clang-format.patch, CMakeCache.txt, console-log.txt, test-results.xml
Pre-merge checks is in beta. Report issue. Please join beta or enable it for your project.
Unit tests: pass. 62196 tests passed, 0 failed and 815 were skipped.
clang-tidy: pass.
clang-format: pass.
Build artifacts: diff.json, clang-tidy.txt, clang-format.patch, CMakeCache.txt, console-log.txt, test-results.xml
Pre-merge checks is in beta. Report issue. Please join beta or enable it for your project.
mlir/docs/SymbolsAndSymbolTables.md | ||
---|---|---|
7 | nice does not seems "nice" here ;) What about "One advantage of the MLIR design is that... "? | |
40 | resides within a region that defines a SymbolTable isn't accurate I believe because of the transitivity aspect. | |
42 | within the closest parent operation defining a `SymbolTable` | |
74 | The part about "dialects may need to ensure that their operations support SymbolRefs and SSA values," isn't clear to me. | |
88 | SymbolRefs instead of Symbols here (since this is about defining uses) | |
115 | The transitively nested aspect is ignored here again. | |
146 | I would add " but cannot be referenced externally: all the uses are in the parent regions" |
mlir/docs/SymbolsAndSymbolTables.md | ||
---|---|---|
27 | I am having a bit of trouble inferring whether this refers to thread-safe, or thread-safe but expensive locking or thread-safe with locking that is not expensive or something else. | |
51 | s/An/A/ | |
89 | Unrelated question, would this (be a reasonable mechanism for | could be extended to support) aliasing for buffer-like semantics? One of the difficulties when writing DRR for Linalg on tensors is that there are no use-def chains but instead aliasings coming from taking subviews and from a memref being an "input or an output operand" of a linalg op. Some of the mechanisms you put in place here seem like they could apply and maybe make things significantly better re writing chains of read/write dependencies. The big missing thing would be supporting control-flow but it's not like I'm doing anything with that anyway atm. Do you see a connection between the 2 or am I imagining things and pattern-matching too much on "alternative to traditional SSA use-list"? |
mlir/docs/SymbolsAndSymbolTables.md | ||
---|---|---|
28 | Symbols or Symbol? | |
31 | Isn't this too far down the page? | |
35 | We can also refer to symbols defined below regions right? Would be nice to be clear here. :) | |
57 | It seems we should move this point to its own part given this part is talking about "*must* adhere to". | |
75 | Each has? | |
115 | Nit: Symbols or Symbols? I think typically we use the latter to mean plural form of some code. |
Add examples, reword a few sections, resolve comments.
mlir/docs/SymbolsAndSymbolTables.md | ||
---|---|---|
42 | Used "immediately within" instead, as "closest parent operation" implies that a symbol can be outside of the immediate region of a symbol table, i.e. at depth>1 | |
74 | Reworded a bit. It is essentially bringing note to the different trade-offs now that there are two different ways to refer to operations. | |
89 | Currently no. The current infrastructure is mainly focused on efficiently/properly supporting global value style references. For example, there is no way to refer to a symbol defined above the current symbol table. That means that mid-function symbol tables would lose the ability to reference other functions. This is an interesting use case, but I'm hesitant to try and generalize when we haven't fully served the existing needs. | |
115 | A symbol is not transitive, a symbol reference is. |
Unit tests: unknown.
clang-tidy: pass.
clang-format: fail. Please format your changes with clang-format by running git-clang-format HEAD^ or applying this patch.
Build artifacts: clang-tidy.txt, clang-format.patch, CMakeCache.txt, console-log.txt
Pre-merge checks is in beta. Report issue. Please join beta or enable it for your project.
mlir/docs/SymbolsAndSymbolTables.md | ||
---|---|---|
5 | This opening sentence is broken grammatically. | |
96 | -> "closest parent op that has a symbol table". Otherwise, it's not clear here whether this means "closest parent op that has a symbol table" or "closest parent op that defines the symbol if any". Unless I missed it, the resolution part isn't documented above. |
This opening sentence is broken grammatically.