[llvm-dev] AMDGPU and support for the new pass manager

Sameer Sahasrabuddhe via llvm-dev llvm-dev at lists.llvm.org
Wed Jan 20 08:40:11 PST 2021


Hi Arthur,



Thanks for following up!



We decided to pin the failing test (divergent-unswitch.ll) to the old pass manager for now, so this is no longer a blocker for flipping the bit in opt.

https://reviews.llvm.org/D95051


The loop-unswitch transform needs divergence analysis to ensure that loops with a divergent conditions are not transformed. This is a correctness issue, which means that the lack of a DA makes loop-unswitching in the NPM unsafe for AMDGPU or any other target that cares about divergence. For now, I've filed a bug to track this: https://bugs.llvm.org/show_bug.cgi?id=48819



I am currently attempting to make the new divergence analysis available on the new pass manager.



Sameer.





---- On Tue, 19 Jan 2021 23:01:01 +0530 Arthur Eubanks <aeubanks at google.com> wrote ----



Any update on this? This is the last known remaining NPM issue assuming https://reviews.llvm.org/D94153 is good to go.



On Thu, Jan 14, 2021 at 10:16 AM Arthur Eubanks <mailto:aeubanks at google.com> wrote:

Here's what I understood so far from a general eyeballing of the code:
 
 1. Legacy DA is a wrapper around GPU DA. I could not find any direct use of GPU DA.
 2. It is likely that AMDGPU no longer "requires" Legacy DA. The advantage of the Legacy DA is that it can handle irreducible regions, but we usually convert them into loops for AMDGPU anyway. I don't know if we have reached a point where we don't care about legacy DA in this respect.
 3. StructurizeCFG under the new pass manager simply skips DA, and consequently cannot skip uniform regions. This essentially disables an optimization when moving to the new pass manager.
 4. Similarly, loop unswitching is an optimization and available in its simple form with the new pass manager. But I don't know for sure if it *must* skip loops with divergent values.
 
 So we (the AMDGPU folks) need to figure out how much is our dependency on any DA in the new pass manager. Besides the above optimizations, isn't it required for later target optimizations around SGPR usage? Is it possible to unblock the transition to the new pass manager, and then later restore these optimizations? Also, I am wondering if can focus on making only the new GPU DA available subject to #2 above. 



To be clear, currently the new PM switch only affects the optimization pipeline, which out of all the uses of Legacy DA only affects LoopUnswitch and StructurizeCFG. The other uses are in the codegen pipeline which isn't affected.

 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20210120/54d6f226/attachment.html>


More information about the llvm-dev mailing list