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
Translate VM Function to C Code #2842
Conversation
Rebased onto main and bumped EmitC submodule (now taking into account the changed dialect registration in LLVM as well as Simon's changes). |
Rebased onto main to make Ben's changes introduced with #3091 available and updated the EmitC submodule. |
This partly reuses the emitc translation
This is required due to the calling convention introduced in the native module. We still need to fix the CModuleTarget to generate the correct code automatically, which is currently hand-written and embedded into the header.
We added a unit test, which uses (parts of) the generated header. Missing parts will be added in follow up PRs. |
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.
other than shuffling a file this looks great!
@@ -0,0 +1,22 @@ | |||
// Copyright 2020 Google LLC |
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 think we should move this into iree/vm/; that way all code that is being cross-compiled for targets is not dependent on anything under iree/compiler/ (and you could, in theory, not have iree/compiler/ set up in your build system at all after the code has been generated)
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.
Thanks for the suggestion! I shuffled the file and the build passes locally. Thus, I would appreciate if you could merge the PR if the build pipeline I just triggered passes.
* 903f809 Script to update to llvm syncpoint (#3155) * a398c96 Translate VM Function to C Code (#2842) * f941efb Multistage docker containers with RBE swiftshader support (#3065) * b7d5710 [spirv] Extract common SPIR-V target functionalities out (NFC) (#3140) * f5fe759 Use generated function to compute number of workgroups to be launched. (#3095) * b89191c Merge google -> main (#3143) COPYBARA_INTEGRATE_REVIEW=#3160 from ScottTodd:main-to-google 903f809 PiperOrigin-RevId: 331891580
* 903f809 Script to update to llvm syncpoint (#3155) * a398c96 Translate VM Function to C Code (#2842) * f941efb Multistage docker containers with RBE swiftshader support (#3065) * b7d5710 [spirv] Extract common SPIR-V target functionalities out (NFC) (#3140) * f5fe759 Use generated function to compute number of workgroups to be launched. (#3095) * b89191c Merge google -> main (#3143) COPYBARA_INTEGRATE_REVIEW=#3160 from ScottTodd:main-to-google 903f809 PiperOrigin-RevId: 331891580
This is a follow up on #2536 and implements the translation of a vm function as outlined in #1173.
Co-authored-by: Marius Brehler marius.brehler@iml.fraunhofer.de