[PATCH] D98958: [NewPM] Disable non-trivial loop-unswitch on targets with divergence

Sameer Sahasrabuddhe via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 19 08:52:25 PDT 2021


sameerds created this revision.
Herald added subscribers: kerbowa, hiraditya, nhaehnle, jvesely.
sameerds requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Unswitching a loop on a non-trivial divergent branch is expensive
since it serializes the execution of both version of the
loop. But identifying a divergent branch needs divergence analysis,
which is a function level analysis.

The legacy pass manager handles this dependency by isolating such a
loop transform and rerunning the required function analyses. This
functionality is currently missing in the new pass manager, and there
is no safe way for the SimpleLoopUnswitch pass to depend on
DivergenceAnalysis. So we conservatively assume that all non-trivial
branches are divergent if the target has divergence.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D98958

Files:
  llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp
  llvm/test/Transforms/LoopUnswitch/AMDGPU/divergent-unswitch.ll
  llvm/test/Transforms/LoopUnswitch/AMDGPU/uniform-unswitch.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D98958.331899.patch
Type: text/x-patch
Size: 5497 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210319/708b8b39/attachment.bin>


More information about the llvm-commits mailing list