[all-commits] [llvm/llvm-project] e53a9d: Resubmit: [AMDGPU] Invert the handling of skip ins...

Carl Ritson via All-commits all-commits at lists.llvm.org
Tue Jan 21 20:19:09 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: e53a9d96e6a074aa7f81ec104eb18e82997c7206
      https://github.com/llvm/llvm-project/commit/e53a9d96e6a074aa7f81ec104eb18e82997c7206
  Author: cdevadas <cdevadas at amd.com>
  Date:   2020-01-22 (Wed, 22 Jan 2020)

  Changed paths:
    M llvm/lib/Target/AMDGPU/AMDGPU.h
    M llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp
    M llvm/lib/Target/AMDGPU/CMakeLists.txt
    M llvm/lib/Target/AMDGPU/SIInsertSkips.cpp
    M llvm/lib/Target/AMDGPU/SILowerControlFlow.cpp
    A llvm/lib/Target/AMDGPU/SIRemoveShortExecBranches.cpp
    M llvm/test/CodeGen/AMDGPU/GlobalISel/divergent-control-flow.ll
    M llvm/test/CodeGen/AMDGPU/atomic_optimizations_local_pointer.ll
    M llvm/test/CodeGen/AMDGPU/atomic_optimizations_pixelshader.ll
    M llvm/test/CodeGen/AMDGPU/branch-condition-and.ll
    M llvm/test/CodeGen/AMDGPU/branch-relaxation.ll
    M llvm/test/CodeGen/AMDGPU/call-skip.ll
    M llvm/test/CodeGen/AMDGPU/collapse-endcf.ll
    M llvm/test/CodeGen/AMDGPU/control-flow-fastregalloc.ll
    M llvm/test/CodeGen/AMDGPU/convergent-inlineasm.ll
    M llvm/test/CodeGen/AMDGPU/cse-phi-incoming-val.ll
    M llvm/test/CodeGen/AMDGPU/divergent-branch-uniform-condition.ll
    M llvm/test/CodeGen/AMDGPU/else.ll
    M llvm/test/CodeGen/AMDGPU/hoist-cond.ll
    M llvm/test/CodeGen/AMDGPU/insert-skips-flat-vmem.mir
    M llvm/test/CodeGen/AMDGPU/insert-skips-gws.mir
    M llvm/test/CodeGen/AMDGPU/insert-skips-ignored-insts.mir
    M llvm/test/CodeGen/AMDGPU/insert-skips-kill-uncond.mir
    M llvm/test/CodeGen/AMDGPU/mubuf-legalize-operands.ll
    M llvm/test/CodeGen/AMDGPU/mul24-pass-ordering.ll
    M llvm/test/CodeGen/AMDGPU/ret_jump.ll
    M llvm/test/CodeGen/AMDGPU/si-annotate-cf-noloop.ll
    M llvm/test/CodeGen/AMDGPU/si-lower-control-flow-unreachable-block.ll
    M llvm/test/CodeGen/AMDGPU/si-lower-control-flow.mir
    M llvm/test/CodeGen/AMDGPU/skip-branch-taildup-ret.mir
    M llvm/test/CodeGen/AMDGPU/skip-branch-trap.ll
    M llvm/test/CodeGen/AMDGPU/skip-if-dead.ll
    M llvm/test/CodeGen/AMDGPU/smrd_vmem_war.ll
    M llvm/test/CodeGen/AMDGPU/stack-pointer-offset-relative-frameindex.ll
    M llvm/test/CodeGen/AMDGPU/subreg-coalescer-undef-use.ll
    M llvm/test/CodeGen/AMDGPU/uniform-cfg.ll
    M llvm/test/CodeGen/AMDGPU/uniform-loop-inside-nonuniform.ll
    M llvm/test/CodeGen/AMDGPU/valu-i1.ll
    M llvm/test/CodeGen/AMDGPU/wave32.ll
    M llvm/test/CodeGen/AMDGPU/wqm.ll

  Log Message:
  -----------
  Resubmit: [AMDGPU] Invert the handling of skip insertion.

The current implementation of skip insertion (SIInsertSkip) makes it a
mandatory pass required for correctness. Initially, the idea was to
have an optional pass. This patch inserts the s_cbranch_execz upfront
during SILowerControlFlow to skip over the sections of code when no
lanes are active. Later, SIRemoveShortExecBranches removes the skips
for short branches, unless there is a sideeffect and the skip branch is
really necessary.

This new pass will replace the handling of skip insertion in the
existing SIInsertSkip Pass.

Differential revision: https://reviews.llvm.org/D68092


  Commit: 6b4b3e2856dc6037ae79947a60a02a4d3e94e9e2
      https://github.com/llvm/llvm-project/commit/6b4b3e2856dc6037ae79947a60a02a4d3e94e9e2
  Author: Carl Ritson <carl.ritson at amd.com>
  Date:   2020-01-22 (Wed, 22 Jan 2020)

  Changed paths:
    M llvm/lib/Target/AMDGPU/SIRemoveShortExecBranches.cpp
    M llvm/test/CodeGen/AMDGPU/divergent-branch-uniform-condition.ll
    M llvm/test/CodeGen/AMDGPU/valu-i1.ll

  Log Message:
  -----------
  [AMDGPU] SIRemoveShortExecBranches should not remove branches exiting loops

Summary:
Check that a s_cbranch_execz is not a loop exit before removing it.
As the pass is generating infinite loops.

Reviewers: cdevadas, arsenm, nhaehnle

Reviewed By: nhaehnle

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

Tags: #llvm

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


Compare: https://github.com/llvm/llvm-project/compare/e0a6093a744d...6b4b3e2856dc


More information about the All-commits mailing list