Harshita Kalani

Week 8 of GSoC 2024: Enhancing Intrinsics and Introducing the Simplifier Pass

Hello, I'm back with the blog post for week 8. This week, I began with implementing the spread intrinsic. I completed a basic implementation that handles 1D and 2D return types. The PR was merged, but there are several improvements that can be addressed in subsequent PRs.
This week, I also took on something new: working on the simplifier pass. This pass will help create auxiliaries for expressions, also ensuring that allocatables are only created when necessary. It includes a verifier to catch bugs early, preventing them from reaching the LLVM backend. This refactoring is aimed to streamline and speed up multiple passes, making debugging and compiling larger codes easier.
I'm having regular meetings with Gagandeep, who initiated this project. He explained the working of this pass. While the pass is almost implemented, there are several bugs that need to be fixed while executing the integration tests. I'm working on them. I could fix some simple bugs and am trying to understand its working in more detail.
I then looked into the ishftc, conjg, and bit_size intrinsics and added tests for them. During this process, I discovered that some intrinsics do not yet have runtime implementations. I've opened an issue for this and believe we should at least throw an error indicating that the intrinsic is not yet implemented for runtime parameters.
In the weekly meeting with Ondřej, we discussed the issues with handling optional arguments for array intrinsics. We developed a plan for addressing these issues, and I have started working on it. I'll soon open a PR and continue working on it next week, along with the simplifier pass.
For the upcoming week, I plan to work on the following tasks:

  • Continue working on the simplifier pass
  • Support optional arguments for minloc and maxloc
  • Add integration tests and resolve bugs related to intrinsics
Progress tracker: #4017.
I found this week's work really exciting and am grateful to Ondřej Čertík and the rest of the mentors at LFortran for their constant reviews and suggestions. I look forward to next week and am eager to complete the planned tasks. Stay tuned for more updates!

Here's a link to related blogs:
GSoC: Week 4
GSoC: Week 5
GSoC: Week 6
GSoC: Week 7