Skip to content
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

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

halvorlinder
Copy link
Contributor

Requires EECS-NTNU/mlir_rvsdg#8

Graph imports are reprsented by omega argument ops at the beginning of the omega block

for (size_t i = 0; i < graph.GetRootRegion().narguments(); ++i)
{
auto arg = graph.GetRootRegion().argument(i);
auto imp = dynamic_cast<llvm::GraphImport *>(arg);
Copy link
Collaborator

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);
Copy link
Collaborator

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()?

Copy link
Collaborator

@haved haved left a 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 GraphImports 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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants