[all-commits] [llvm/llvm-project] 0f1df4: AMDGPU/SIInsertSkips: Fix the determination of whe...

Nicolai Hähnle via All-commits all-commits at lists.llvm.org
Wed Feb 26 06:30:51 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 0f1df4892538ccd9ecc23d68c65c7bd2b00f3f01
      https://github.com/llvm/llvm-project/commit/0f1df4892538ccd9ecc23d68c65c7bd2b00f3f01
  Author: Nicolai Hähnle <nicolai.haehnle at amd.com>
  Date:   2020-02-26 (Wed, 26 Feb 2020)

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

  Log Message:
  -----------
  AMDGPU/SIInsertSkips: Fix the determination of whether early-exit-after-kill is possible

Summary:
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.

v2: preserve the dominator tree

Reviewers: arsenm, cdevadas, foad, critson

Subscribers: kzhuravl, jvesely, wdng, yaxunl, dstuttard, tpr, t-tye, hiraditya, kerbowa, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D74908

Change-Id: Ia0d2b113ac944ad642d1c622b6da1b20aa1aabcc




More information about the All-commits mailing list