[PATCH] D59136: AMDGPU: Move d16 load matching to preprocess step

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 8 08:27:22 PST 2019


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

When matching half of the build_vector to a load, there could still be
a hidden dependency on the other half of the build_vector the pattern
wouldn't detect. If there was an additional chain dependency on the
other value, a cycle could be introduced.

     

I don't think a tablegen pattern is capable of matching the necessary
conditions, so move this into PreprocessISelDAG. Check isPredecessorOf
for the other value to avoid a cycle. This has a warning that it's
expensive, so this should probably be moved into an MI pass eventually
that will have more freedom to reorder instructions to help match
this. That is currently complicated by the lack of a computeKnownBits
type mechanism for the selected function.


https://reviews.llvm.org/D59136

Files:
  lib/Target/AMDGPU/AMDGPU.td
  lib/Target/AMDGPU/AMDGPUISelDAGToDAG.cpp
  lib/Target/AMDGPU/AMDGPUISelLowering.cpp
  lib/Target/AMDGPU/AMDGPUISelLowering.h
  lib/Target/AMDGPU/AMDGPUInstructions.td
  lib/Target/AMDGPU/AMDGPUSubtarget.h
  lib/Target/AMDGPU/BUFInstructions.td
  lib/Target/AMDGPU/DSInstructions.td
  lib/Target/AMDGPU/FLATInstructions.td
  lib/Target/AMDGPU/SIInstrInfo.td
  test/CodeGen/AMDGPU/build-vector-insert-elt-infloop.ll
  test/CodeGen/AMDGPU/chain-hi-to-lo.ll
  test/CodeGen/AMDGPU/load-hi16.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D59136.189864.patch
Type: text/x-patch
Size: 38033 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190308/1e062f7f/attachment.bin>


More information about the llvm-commits mailing list