[PATCH] D74180: AMDGPU: Limit the search in finding the instruction pattern for v_swap generation.

Changpeng Fang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 6 16:23:38 PST 2020


cfang created this revision.
cfang added reviewers: arsenm, rampitec.
Herald added subscribers: kerbowa, hiraditya, t-tye, tpr, dstuttard, yaxunl, nhaehnle, wdng, jvesely, kzhuravl.
Herald added a project: LLVM.

Current implementation of matchSwap in SIShrinkInstructions searches the entire use_nodbg_operands set to find the possible
pattern to generate v_swap instruction. This approach will lead to a O(N^3) in compile time for SIShrinkInstructions.

But in reality, the matching pattern only exists within nearby instructions in the same basic block. This work limits the search to a maximum of
16 instructions, and has a linear compile time comsumption.


https://reviews.llvm.org/D74180

Files:
  llvm/lib/Target/AMDGPU/SIShrinkInstructions.cpp
  llvm/test/CodeGen/AMDGPU/v_swap_b32.mir

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D74180.243039.patch
Type: text/x-patch
Size: 5436 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200207/71365c26/attachment.bin>


More information about the llvm-commits mailing list