-
Notifications
You must be signed in to change notification settings - Fork 15
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
Roundtrip Graph imports #838
base: master
Are you sure you want to change the base?
Conversation
for (size_t i = 0; i < graph.GetRootRegion().narguments(); ++i) | ||
{ | ||
auto arg = graph.GetRootRegion().argument(i); | ||
auto imp = dynamic_cast<llvm::GraphImport *>(arg); |
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.
Bruk util::AssertedCast
return ConvertMlir(block); | ||
auto & topNode = block->front(); | ||
auto omegaNode = ::mlir::dyn_cast<::mlir::rvsdg::OmegaNode>(topNode); | ||
return ConvertOmega(omegaNode); |
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.
Why has this call to ConvertMlir()
been replaced? Isn't the new code identical to the body of ConvertMlir()
?
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 have some small suggestions for the code.
One question I have is if the GraphImports you create during MLIR->RVSDG can actually be used. During conversions of blocks, there is a
std::unordered_map<::mlir::Operation *, rvsdg::Node *> operationsMap;
for mapping operations, but this map never gets the OmagaArgument
and corresponding GraphImport
s added. Since GraphImport
is not a real node, but actually an output*
, we might have to change how the mapping is implemented.
To summarize, I do not think MlirToJlmConverter::GetConvertedInputs
is currently able to convert usage of OmegaArguments
.
Or maybe I am not understanding something?
Requires EECS-NTNU/mlir_rvsdg#8
Graph imports are reprsented by omega argument ops at the beginning of the omega block