-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
ARROW-7819: [C++][Gandiva] Add DumpIR to Filter/Projector object #6417
ARROW-7819: [C++][Gandiva] Add DumpIR to Filter/Projector object #6417
Conversation
6ab97b0
to
2dc7955
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.
LGTM in general, a few comments.
cpp/src/gandiva/arrow.h
Outdated
@@ -25,6 +25,7 @@ | |||
#include <arrow/builder.h> | |||
#include <arrow/pretty_print.h> | |||
#include <arrow/record_batch.h> | |||
#include <arrow/result.h> |
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.
Can't we use type_fwd.h
instead?
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 tried removing the others and minimizing but it unfolded in too many changes.
cpp/src/gandiva/engine.h
Outdated
#include "arrow/util/macros.h" | ||
|
||
#include "gandiva/arrow.h" |
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.
Hmm... can we keep the includes as minimal as possible? Arrow is already slow enough to build.
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.
clangd has this option to automatically add header when auto-completing. I disabled it.
The following patch exposes the generated IR as a method of the objects for further inspection. This is a breaking change for the internal method `FinalizeModule` which doesn't take the dump_ir and optimize flags, it receives `debug` from Configuration now. - Refactored Engine, notably removed dead code, organized init in a single function and simplified LLVMGenerator. - Dumping IR should not write to stdout, but instead return it as a string in the `DumpIR` method. - Refactored Types, fixing some bad methods type. - Added the optimize field to `Configuration` class. - Simplified some unit tests.
2dc7955
to
0bcebc8
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.
Looks good to me.
llvm::Function* fn = module->getFunction(iter.pc_name()); | ||
EXPECT_NE(fn, nullptr) << "function " << iter.pc_name() | ||
<< " missing in precompiled module\n"; | ||
EXPECT_NE(module->getFunction(iter.pc_name()), nullptr); |
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.
having the name in stderr is helpful for debugging.
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 recommend to set this in your .gdbinit
set environment GTEST_BREAK_ON_FAILURE=1
Then you run the failing test under gdb, it'll break at the first failing test.
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.
He might mean that the problem may be more evident from looking at test log files :) I think it's OK for now, if it becomes an issue we can improve
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.
yes, wes - I meant easier to get error from log files or travis output !. but, we'll only hit this when adding new functions - so, it's obvious anyway.
The following patch exposes the generated IR as a method of the objects
for further inspection. This is a breaking change for the internal
method
FinalizeModule
which doesn't take the dump_ir and optimizeflags, it receives
optimize
from Configuration now.function and simplified LLVMGenerator.
string in the
DumpIR
method.Configuration
class.But more importantly, we can now inspect dynamically: