-
Notifications
You must be signed in to change notification settings - Fork 103
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
Convert trivial copy constructor and assignment operator calls to memcpy #1202
Comments
Btw, we have a missing feature for |
Hey Bruno and Shoib, I am new to MLIR/ClangIR space and would love to contribute, I am not sure if I can solve it but I would like to try, can someone give more details on what exactly I need to do or resources that I can look into? Thank you! |
Welcome aboard! The ClangIR website has good resources around getting started, building and testing, etc. For this task, we're concerned with two parts of ClangIR:
Clang's CodeGen directly emits You can search for For introducing the actual The ClangIR Discord channel is another good place to get advice or just say hi (you'll need to join the LLVM Discord server first). Keep in mind though that winter holidays are approaching, so Bruno and I will both be only sporadically available from now till early January. |
Hi Shoib, thank you so much for the detailed response, I am setting up local environment and will continue to explore the code, I am already on LLVM discord and also please enjoy your holidays, I will try to understand the task better on my own before asking for help. |
Sounds good! A few other tips which might be useful:
|
Thank you! I will take this incrementally and work on it over the holidays. Apologies for the delay in my response, as I am currently wrapping up my internship. I have ClangIR installed on my remote machines and was able to generate the AST, CIR, and other components. I'm currently reviewing the Codegen code to understand how the AST is passed to the lower layers. |
CodeGen replaces trivial copy constructors and assignment operators with
memcpy
. ClangIR intentionally doesn't do so when generating CIR, so that all those function calls are available for analysis: https://godbolt.org/z/xcKdzKaWM. We'd ideally switch to the memcpy at some point before generating LLVM though, to generate better code. One potentially idea would be to tag either the functions themselves or the call sites during CIR generation, and then have a later pass (e.g. LoweringPrepare) do the memcpy conversion. Search forisMemcpyEquivalentSpecialMember
under clang/lib/CodeGen for examples of how it handles this.The text was updated successfully, but these errors were encountered: