-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Substrait] Implement first version of NamedTableOp. #797
[Substrait] Implement first version of NamedTableOp. #797
Conversation
6a14dca
to
17e9971
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(just skimmed before next talk ... I should probably see how I could view stacked PRs better :) )
lib/Target/SubstraitPB/Export.cpp
Outdated
return failure(); | ||
|
||
Region &body = op.getBodyRegion(); | ||
if (llvm::range_size(body.getOps()) != 1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a little wasteful/one could early exit without computing total size.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How? The only way I can think of is something like ++body.getOps().begin() != body.op_end()
but that's much less readable, isn't it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed it is, one could also if the first is a terminator, I think your version from comment would be cheaper than that though. One could get creative with zip and seq too , but I think simplest may be a lambda with loop inside from readability point of view (I mean this may not matter, I meant "little" in the non-British use of little :-))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shame! std::ranges::take_view
would be helpful here but it's C++20.
But, actually, maybe std::next(body.op_begin()) != body.op_end()
isn't too bad?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yet another thought: if the IR is valid, then the range of the size is 1, so llvm::range_size
acutally has acceptable cost. Do we really have to optimize for runtime on invalid IR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Based on that last argument, I propose to revert my latest change and go with the initial version. WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Resolving this discussion because (1) the related line wasn't part of this commit, (2) it's the only one left for an otherwise approved PR, (3) we can always come back later: #815.
Thanks! In the "Files changed" tab, where you're probably doing the review, you can change "Show changes from all commits" to a single commit or even a range (by holding shift). |
7657e6b
to
4ad9d15
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, thanks
|
||
include "mlir/IR/OpBase.td" | ||
|
||
def Substrait_RelOpInterface : OpInterface<"RelOpInterface"> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OOC are you going to keep a ordering here of some sorts? (E.g., top to bottom or sorted or by type or ...)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't made up my mind for this file yet. For SubstraitOps.td
, I have sections that correspond to the sections in the spec and the protobuf files of Substrait, and then sort alphabetically inside each section. I guess I'll do the same here (once I figure out if we need sections and which they are).
4ad9d15
to
ad82b52
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All in-line comments addressed with the latest commits. I'll now look again at the top-level discussion.
7f4b5fb
to
8686209
Compare
9b2974b
to
8d4952f
Compare
This op corresponds to a `Rel` message with a `ReadRel` message that, in turn, has a `NamedTable` message. With this op, we are capable of representing a first complete plan in our dialect that we can serialize to protobuf and execute (by copy'n'pasting into an external consumer).
8d4952f
to
196ad1d
Compare
This reverts commit 3f0b68f.
…lvm-sandbox#797) This op corresponds to a `Rel` message with a `ReadRel` message that, in turn, has a `NamedTable` message. With this op, we are capable of representing a first complete plan in our dialect that we can serialize to protobuf and execute (by copy'n'pasting into an external consumer). Signed-off-by: Ingo Müller <[email protected]>
…lvm-sandbox#797) This op corresponds to a `Rel` message with a `ReadRel` message that, in turn, has a `NamedTable` message. With this op, we are capable of representing a first complete plan in our dialect that we can serialize to protobuf and execute (by copy'n'pasting into an external consumer). Signed-off-by: Ingo Müller <[email protected]>
This op corresponds to a
Rel
message with aReadRel
message that, in turn, has aNamedTable
message. With this op, we are capable of representing a first complete plan in our dialect that we can serialize to protobuf and execute (by copy'n'pasting into an external consumer).This PR is based on and, therefor, includes #795.