<div dir="ltr">Hi folks,<br><br>The 16th issue of LLVM GPU News, a bi-weekly newsletter on all the GPU things under the LLVM umbrella, is out:<br><<a href="https://llvm-gpu-news.github.io/2021/07/23/issue-16.html">https://llvm-gpu-news.github.io/2021/07/23/issue-16.html</a>>.<div><br>I also pasted the content below, in case you prefer to read in your email client.<br><div><br>-Jakub</div></div><div><br></div><div>======================================================================<br><br># LLVM GPU News Issue #16, July 23 2021<br>Authors: Jakub Kuderski, Johannes Doerfert, Joseph Huber<br><br>Welcome to LLVM GPU News, a bi-weekly newsletter on all the GPU things under the LLVM umbrella.<br>This issue covers the period from July 2 to July 22 2021.<br><br>We welcome your feedback and suggestions. Let us know if we missed anything interesting, or want us to bring attention to your (sub)project, revisions under review, or proposals. Please see the bottom of the page for details on how to submit suggestions and contribute.<br><br><br>##  LLVM and Clang<br><br>### Discussions<br><br>*  [Frank Winter asked](<a href="https://lists.llvm.org/pipermail/llvm-dev/2021-July/151826.html">https://lists.llvm.org/pipermail/llvm-dev/2021-July/151826.html</a>) about adding support for the [NVSHMEM](<a href="https://developer.nvidia.com/nvshmem">https://developer.nvidia.com/nvshmem</a>) API for GPU clusters to the NVPTX backend. There are no replies as of writing.<br><br><br>### Commits<br><br>*  Backends can now split register allocation into multiple `RegAlloc` runs. This is implemented by giving each `RegAlloc` pass a callback which decides if a register class should be handled or not. AMDGPU uses this to allocate SGPRs and VGPRs separately. Interestingly, this had been in review since December 2018. [D55301](<a href="https://reviews.llvm.org/D55301">https://reviews.llvm.org/D55301</a>)<br>*  OpenCL gained support for new feature macros:<br>   *  `__opencl_c_generic_address_space` [D103401](<a href="https://reviews.llvm.org/D103401">https://reviews.llvm.org/D103401</a>)<br>   *  `__opencl_c_read_write_images` [D104915](<a href="https://reviews.llvm.org/D104915">https://reviews.llvm.org/D104915</a>)<br>   *  `__opencl_c_program_scope_global_variables` [D103191](<a href="https://reviews.llvm.org/D103191">https://reviews.llvm.org/D103191</a>)<br>*  The NVPTX matrix operation intrinsics were extended with the `.and.popc` variant of the `b1` MMA instruction. [D105384](<a href="https://reviews.llvm.org/D105384">https://reviews.llvm.org/D105384</a>)<br>*  Waterfall loops are now marked as `SI_WATERFALL_LOOP` to aid AMDGPU register allocation optimizations. [D105467](<a href="https://reviews.llvm.org/D105467">https://reviews.llvm.org/D105467</a>), [D105192](<a href="https://reviews.llvm.org/D105192">https://reviews.llvm.org/D105192</a>)<br>*  AMDGPU frontends can now generate export-free fragment shaders. [D105683](<a href="https://reviews.llvm.org/D105683">https://reviews.llvm.org/D105683</a>)<br>*  Some AMDGPU instructions are now marked as rematerializable:<br>   *  `SOP` [D105670](<a href="https://reviews.llvm.org/D105670">https://reviews.llvm.org/D105670</a>)<br>   *  `VOP1` [D105742](<a href="https://reviews.llvm.org/D105742">https://reviews.llvm.org/D105742</a>)<br>   *  `VOP2` [D106023](<a href="https://reviews.llvm.org/D106023">https://reviews.llvm.org/D106023</a>)<br>   *  `VOP3` [D106110](<a href="https://reviews.llvm.org/D106110">https://reviews.llvm.org/D106110</a>)<br>*  New `llvm-mca` [`CustomBehaviour` implementation for AMDGPU](<a href="https://reviews.llvm.org/D104730">https://reviews.llvm.org/D104730</a>) to handle the `s_waitcnt` instructions landed but was later [reverted](<a href="https://reviews.llvm.org/rGd38b9f1f31b1fa8ee885cfcd4ee7bd69771088c8">https://reviews.llvm.org/rGd38b9f1f31b1fa8ee885cfcd4ee7bd69771088c8</a>).<br><br><br>## MLIR<br><br>### Discussions<br><br>*  chudur-budur asked about [making linalg.matmul to GPU runnable code](<a href="https://llvm.discourse.group/t/making-linalg-matmul-to-gpu-runnable-code/3910">https://llvm.discourse.group/t/making-linalg-matmul-to-gpu-runnable-code/3910</a>) that can be executed with the CUDA runtime. There are no replies as of writing.<br><br>### Commits<br><br><br>## OpenMP (Target Offloading)<br><br>### Discussions<br><br>### Commits<br><br>*  The first GPU runtime specific call folding has been pushed [D105787](<a href="https://reviews.llvm.org/D105787">https://reviews.llvm.org/D105787</a>), though there are issues still to be resolved right now. Folding of more runtime calls is already prepared (e.g., [D106154](<a href="https://reviews.llvm.org/D106154">https://reviews.llvm.org/D106154</a>), [D106033](<a href="https://reviews.llvm.org/D106033)">https://reviews.llvm.org/D106033)</a>).<br>*  OpenMP-Opt will now emit more concise remarks with ID tags [D105939](<a href="https://reviews.llvm.org/D105939">https://reviews.llvm.org/D105939</a>). The OpenMP documentation does describe these remarks in detail, with examples and mitigation strategies where applicable [D106018](<a href="https://reviews.llvm.org/D106018">https://reviews.llvm.org/D106018</a>).<br>*  SPMDization detection was extended to include `AAHeapToStack`/`AAHeapToShared` analysis results [D105634](<a href="https://reviews.llvm.org/D105634">https://reviews.llvm.org/D105634</a>). This optimization, first introduced in [D102307](<a href="https://reviews.llvm.org/D102307">https://reviews.llvm.org/D102307</a>), transforms Generic-mode OpenMP kernels that contain separate worker / main threads into an SPMD kernel where all threads are worker threads and active throughout the entire region. This is closer to how CUDA operates and is generally faster when we can perform this optimization. The new patch allows it to handle globalization. We're still missing a third optimization which guards operations meant to be done by a single thread with a barrier before there is full support. Even though full support is still in progress, we have already seen good improvements from this transformation.<br><br><br>## External Compilers<br><br>### LLPC<br><br>### Mesa<br><br>*  David Airlie is working on bringing back the Mesa OpenCL 3.0 support and [ran into issues with the SPIR target always enabling all CL optional extensions](<a href="https://lists.llvm.org/pipermail/cfe-dev/2021-July/068522.html">https://lists.llvm.org/pipermail/cfe-dev/2021-July/068522.html</a>). Anastasia Stulova noted that [SPIR was originally added as a device agnostic-target](<a href="https://lists.llvm.org/pipermail/cfe-dev/2021-July/068526.html">https://lists.llvm.org/pipermail/cfe-dev/2021-July/068526.html</a>). However, for Mesa/clover, it is [desirable to provide Clang a concrete device](<a href="https://lists.llvm.org/pipermail/cfe-dev/2021-July/068527.html">https://lists.llvm.org/pipermail/cfe-dev/2021-July/068527.html</a>) and the list of supported extensions.<br><br></div></div>