Hello,
For the past 3-4 months, I’ve been involved in a rotation project, focusing on the Flang compiler. My primary responsibility was to provide the support for intrinsics, both standard and extensions.
Here’s a summary of the intrinsics I worked on:
This experience has been a significant learning curve for me. I’ve gained insights into various areas, from the C++ language to operating systems, compiler design, and synchronous and asynchronous execution. Despite never having used C++ before or worked on a large-scale repository, I’ve managed to make progress, even though I still have much to learn.
One of the key takeaways from working with Flang runtime is the differences in OS between Linux and Windows. Some functions or libraries cannot be easily ported between different operating systems. For example, the fdate function (which retrieves the date and time in ctime format) calls ctime_s on Windows and ctime_r on Linux.
Another notable difference is between CreateProcess() Windows and fork() Linux when implementing the asynchronous mode of execute_command_line. There were many issues going on with harvesting a finished process in async mode, and special thanks to @DavidTruby for suggesting the use of setsid() to separate processes so that finished children can be harvested by the init process. Additionaly, thanks to @jeffhammond for providing the initial implementation of execute_command_line.
I’ve also learned a bit about dialects when implementing Overflow flags support for the arith dialect with the help from @Hardcode84. I’ve also provided some review comments in others’ pull requests, which was a good opportunity to give/share knowledge back to where I took it from. [mlir] [arith] add shl overflow flag in Arith and lower to SPIR-V and LLVMIR by yi-wu-arm · Pull Request #79828 · llvm/llvm-project (github.com)
I would like to thank @klausler, @jeanPerier, @DavidTruby, @tblah, and @kiranchandramohan for reviewing my code, and to @psteinfeld for testing execute_command_line and raising issues when it crashed. The community has been instrumental in helping me learn about the repository and some features of C++. I couldn’t have accomplished all this without your help.
Many Thanks,
Yi