[PATCH] D35861: [AMDGPU] Optimize SI_IF lowering for simple if regions

Stanislav Mekhanoshin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 25 15:54:33 PDT 2017


rampitec created this revision.
Herald added subscribers: t-tye, tpr, dstuttard, yaxunl, nhaehnle, wdng, kzhuravl, qcolombet, MatzeB.

Currently SI_IF results in a s_and_saveexec_b64 followed by s_xor_b64.
The xor is used to extract only the changed bits. In case of a simple
if region where the only use of that value is in the SI_END_CF to
restore the old exec mask, we can omit the xor and perform an or of
the exec mask with the original exec value saved by the
s_and_saveexec_b64.


https://reviews.llvm.org/D35861

Files:
  lib/Target/AMDGPU/SILowerControlFlow.cpp
  test/CodeGen/AMDGPU/branch-condition-and.ll
  test/CodeGen/AMDGPU/branch-relaxation.ll
  test/CodeGen/AMDGPU/control-flow-fastregalloc.ll
  test/CodeGen/AMDGPU/i1-copy-phi.ll
  test/CodeGen/AMDGPU/llvm.amdgcn.div.fmas.ll
  test/CodeGen/AMDGPU/multi-divergent-exit-region.ll
  test/CodeGen/AMDGPU/ret_jump.ll
  test/CodeGen/AMDGPU/si-lower-control-flow-unreachable-block.ll
  test/CodeGen/AMDGPU/skip-if-dead.ll
  test/CodeGen/AMDGPU/subreg-coalescer-undef-use.ll
  test/CodeGen/AMDGPU/uniform-cfg.ll
  test/CodeGen/AMDGPU/uniform-loop-inside-nonuniform.ll
  test/CodeGen/AMDGPU/valu-i1.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D35861.108177.patch
Type: text/x-patch
Size: 13878 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170725/71ae0bd5/attachment.bin>


More information about the llvm-commits mailing list