If we don't specify the result index while matching operand with the
result of certain operation, it's supposed to match all the results of
the operation with the operand. For registered op, it's easy to do that
by either indexing with number or name. For unregistered op, this commit
enables the numeric result indexing for this use case.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
mlir/lib/Tools/PDLL/Parser/Parser.cpp | ||
---|---|---|
2687–2688 | "Allow unchecked numeric indexing of the results of unregistered operations. It returns a single value." |
Given that we can't know the "result groups" of an unregistered operation, I think defaulting to individual results is fine. That being said, we'll definitely want to document this behavior (given that it means we'll treat registered operations differently from registered). Can you document the handling for unregistered operations in the Accessing Operation Results section of PDLL.md?
mlir/lib/Tools/PDLL/CodeGen/MLIRGen.cpp | ||
---|---|---|
448 | I don't think sharing this variable is useful given that the branches don't converge, can we just duplicate? Otherwise, I have to follow the control flow to make sure it isn't used in an uninitialized context. |
Address review comment and update the op name in the test
mlir/lib/Tools/PDLL/CodeGen/MLIRGen.cpp | ||
---|---|---|
448 | Yep, that's weird. was changing the structure at the last moment and forgot it. Done |
mlir/docs/PDLL.md | ||
---|---|---|
703 | Can you have a dedicated sub-section for unregistered operations? #### Unregistered Operations ... Just want to make sure this gets the callout that it deserves, so that it isn't potentially lost inside of another paragraph. |
Address review comment
mlir/docs/PDLL.md | ||
---|---|---|
703 | Done, let me know if the description is fine. |
Can you have a dedicated sub-section for unregistered operations?
Just want to make sure this gets the callout that it deserves, so that it isn't potentially lost inside of another paragraph.