[PATCH] D19041: AMDGPU: Remove SIFixSGPRLiveRanges pass

Nicolai Hähnle via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 12 16:35:53 PDT 2016


nhaehnle created this revision.
nhaehnle added reviewers: arsenm, tstellarAMD.
nhaehnle added a subscriber: llvm-commits.
Herald added subscribers: arsenm, MatzeB.

This pass is unnecessary and overly conservative. It was motivated by
situations like

  def %vreg0:SGPR_32
  ...
if-block:
  ..
  def %vreg1:SGPR_32
  ...
else-block:
  ...
  use %vreg0:SGPR_32
  ...

and similar situations with uses after the non-uniform control flow, where
we are not allowed to assign %vreg0 and %vreg1 to the same physical register,
even though in the original, thread/workitem-based CFG, it looks like the
live ranges of these registers do not overlap.

However, by the time register allocation runs, we have moved to a wave-based
CFG that accurately represents the fact that the wave may run through both
the if- and the else-block. So the live ranges of %vreg0 and %vreg1 already
overlap even without the SIFixSGPRLiveRanges pass.

In addition to proving this change correct, I have tested it with Piglit
and a small number of other tests.

http://reviews.llvm.org/D19041

Files:
  lib/Target/AMDGPU/AMDGPU.h
  lib/Target/AMDGPU/AMDGPUTargetMachine.cpp
  lib/Target/AMDGPU/CMakeLists.txt
  lib/Target/AMDGPU/SIFixSGPRLiveRanges.cpp
  test/CodeGen/AMDGPU/subreg-coalescer-undef-use.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D19041.53492.patch
Type: text/x-patch
Size: 11142 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160412/63d8facf/attachment.bin>


More information about the llvm-commits mailing list