[PATCH] D74908: AMDGPU/SIInsertSkips: Fix the determination of whether early-exit-after-kill is possible

Nicolai Hähnle via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 20 09:15:48 PST 2020


nhaehnle created this revision.
nhaehnle added reviewers: arsenm, cdevadas, foad, critson.
Herald added subscribers: kerbowa, hiraditya, t-tye, tpr, dstuttard, yaxunl, wdng, jvesely, kzhuravl.
Herald added a project: LLVM.

The old code made some incorrect assumptions about the order in which
basic blocks are laid out in a function. This could lead to incorrect
early-exits, especially when kills occurred inside of loops.

The new approach is to check whether the point where the conditional
kill occurs dominates all reachable code. If that is the case, there
cannot be any other threads in the wave that are waiting to rejoin
at a later point in the CFG, i.e. if exec=0 at that point, then all
threads really are dead and we can exit the wave.

Make some other minor cleanups to the pass while we're at it.

Change-Id: Ia0d2b113ac944ad642d1c622b6da1b20aa1aabcc


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D74908

Files:
  llvm/lib/Target/AMDGPU/SIInsertSkips.cpp
  llvm/test/CodeGen/AMDGPU/skip-if-dead.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D74908.245672.patch
Type: text/x-patch
Size: 17720 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200220/daad97f1/attachment.bin>


More information about the llvm-commits mailing list