[PATCH] D53762: AMDGPU: Combine DPP mov with use instuctions

Valery Pykhtin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 26 07:46:22 PDT 2018


vpykhtin created this revision.
vpykhtin added reviewers: rampitec, arsenm, tpr, b-sumner, kzhuravl, AMDGPU.
vpykhtin added a project: AMDGPU.
Herald added subscribers: llvm-commits, kbarton, t-tye, dstuttard, yaxunl, mgorny, nhaehnle, wdng, jvesely, nemanjai.

The change adds DPP instruction pseudos and the pass combining V_MOV_B32_dpp instruction with its VALU uses as a DPP src0 operand. If any of the use instruction cannot be combined with the mov the whole sequence is reverted.

$old = ...  
$dpp_value = V_MOV_B32_dpp $old, $vgpr_to_be_read_from_other_lane, dpp_controls..., $bound_ctrl
$res = VALU $dpp_value, ...

to

$res = VALU_DPP $folded_old, $dpp_value, ..., dpp_controls..., $folded_bound_ctrl

Combining rules:

$bound_ctrl is DPP_BOUND_ZERO, $old is any
$bound_ctrl is DPP_BOUND_OFF, $old is 0

  -> $folded_old = undef, $folded_bound_ctrl = DPP_BOUND_ZERO

$bound_ctrl is DPP_BOUND_OFF, $old is undef

  -> $folded_old = undef, $folded_bound_ctrl = DPP_BOUND_OFF

$bound_ctrl is DPP_BOUND_OFF, $old is foldable

  -> $folded_old = folded value, $folded_bound_ctrl = DPP_BOUND_OFF

FMAC and MAC instructions doesn't have $old operand, as it already have tied $src2.


Repository:
  rL LLVM

https://reviews.llvm.org/D53762

Files:
  lib/Target/AMDGPU/AMDGPU.h
  lib/Target/AMDGPU/AMDGPU.td
  lib/Target/AMDGPU/AMDGPUTargetMachine.cpp
  lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp
  lib/Target/AMDGPU/CMakeLists.txt
  lib/Target/AMDGPU/GCNDPPCombine.cpp
  lib/Target/AMDGPU/SIInstrInfo.cpp
  lib/Target/AMDGPU/SIInstrInfo.h
  lib/Target/AMDGPU/SIInstrInfo.td
  lib/Target/AMDGPU/VOP1Instructions.td
  lib/Target/AMDGPU/VOP2Instructions.td
  lib/Target/AMDGPU/VOPInstructions.td
  test/CodeGen/AMDGPU/dpp_combine.ll
  test/CodeGen/AMDGPU/dpp_combine_subregs.mir
  test/MC/AMDGPU/vop_dpp.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D53762.171300.patch
Type: text/x-patch
Size: 47331 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181026/3ad813f1/attachment.bin>


More information about the llvm-commits mailing list