[PATCH] D54164: [AMDGPU] Optimize S_CBRANCH_VCC[N]Z -> S_CBRANCH_EXEC[N]Z

Stanislav Mekhanoshin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 6 11:11:21 PST 2018


rampitec created this revision.
rampitec added a reviewer: nhaehnle.
Herald added subscribers: t-tye, tpr, dstuttard, yaxunl, wdng, jvesely, kzhuravl, arsenm.

Sometimes after basic block placement we end up with a code like:

  sreg = s_mov_b64 -1
  vcc = s_and_b64 exec, sreg
  s_cbranch_vccz

This happens as a join of a block assigning -1 to a saved mask and
another block which consumes that saved mask with s_and_b64 and a
branch.

This is essentially a single s_cbranch_execz instruction when moved
into a single new basic block.


https://reviews.llvm.org/D54164

Files:
  lib/Target/AMDGPU/SIInsertSkips.cpp
  test/CodeGen/AMDGPU/branch-relaxation.ll
  test/CodeGen/AMDGPU/infinite-loop.ll
  test/CodeGen/AMDGPU/insert-skip-from-vcc.mir

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D54164.172798.patch
Type: text/x-patch
Size: 11924 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181106/3e55b3be/attachment.bin>


More information about the llvm-commits mailing list