<div dir="ltr">Dear Community,<div><br></div><div>in an earlier post, students working on LLVM were asked to provide a short report on</div><div>their GSoC project. in the following I want to give an overview on the current status of my</div><div>GSoC project and outline my next planned activities. Since my mentoring organization is Julia,</div><div>I also send this to the according mailing list.</div><div><br></div><div><b><font size="2">1. Activities so far:</font></b></div><div><br></div><div>As described in my proposal [1], I am working on making available Polly's optimizations on Julia.<br></div><div>Within the pull-requests [2] and [3] I integrated Polly into Julia's LLVM-based JIT infrastructure.</div><div>Polly can now be explicitly used to optimize Julia functions that are annotated with the newly</div><div>introduced `@polly` macro. You may also read my blog post [4] on this topic, which illustrates how</div><div>these new features can be used in Julia. In a next step I used first micro benchmarks to analyze</div><div>the LLVM code that Julia produces internally and tried to determine characteristics of the produced</div><div>code that prevents Polly from applying its optimizations. For a more comprehensive evaluation,</div><div>I ported the PolyBench benchmark suite to Julia. My recent blog post [5] provides more details on this.</div><div><br></div><div>These benchmarks helped to identify Julia constructs which hinder Polly's SCoP detection. `for`-loops</div><div>for which both the lower and the upper bound are parametric are lowered to LLVM code that restrain</div><div>ScalarEvolution analysis and has been discussed in the bug report at [6]. It was possible to solve</div><div>this problem and I will shortly supply a patch for this. Another language construct that is lowered to</div><div>LLVM IR that limits the optimization potential are Julia's `StepRange`s. More concretely, this regards</div><div>loops of the form `for i = lower_bound:step:upper_bound`. They will prevent optimizations especially</div><div>when occurring inside other loops.</div><div><br></div><div><b>2. Next steps:</b></div><div><br></div><div>It is planned to complete the analysis of Polly on Julia code on the existing benchmarks and solve the</div><div>problems mentioned above. Furthermore, I plan to extend the analysis to find critical code</div><div>parts. Therefore I plan to use computation kernels from Julia's base library to detect further regions that</div><div>cause Polly to fail to perform optimizations.</div><div><br></div><div>When the necessary corrections make it possible to apply Polly to a reasonably large amount of Julia</div><div>programs it is furthermore planned to enhance Polly's bound-check-elimination to work in Julia. So far</div><div>it is only possible to optimize Julia code that does not contain bound-checks, that means currently they</div><div>have to be turned off explicitly (either through the `@inbounds` macro or via Julia's `--check-bounds=no`</div><div>command-line switch). The aim is to be able to use Polly in the presence of Julia's bound-checks.</div><div><br></div><div>Best regards,</div><div>Matthias</div><div><br></div><div>[1] <a href="https://docs.google.com/document/d/1s5mmSW965qmOEbHiM3O4XFz-Vd7cy9TxX9RQaTK_SQo/edit?usp=sharing">https://docs.google.com/document/d/1s5mmSW965qmOEbHiM3O4XFz-Vd7cy9TxX9RQaTK_SQo/edit?usp=sharing</a></div><div>[2] <a href="https://github.com/JuliaLang/julia/pull/16531">https://github.com/JuliaLang/julia/pull/16531</a></div><div>[3] <a href="https://github.com/JuliaLang/julia/pull/16726">https://github.com/JuliaLang/julia/pull/16726</a></div><div>[4] <a href="http://www.mreisinger.com/?p=43">http://www.mreisinger.com/?p=43</a></div><div>[5] <a href="http://www.mreisinger.com/?p=137">http://www.mreisinger.com/?p=137</a></div><div>[6] <a href="https://llvm.org/bugs/show_bug.cgi?id=28126">https://llvm.org/bugs/show_bug.cgi?id=28126</a></div></div>