[PATCH] D65961: AMDGPU/SILoadStoreOptimizer: Optimize scanning for mergeable instructions

Tom Stellard via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 8 10:39:16 PDT 2019


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

This adds a pre-pass to this optimization that scans through the basic
block and generates lists of mergeable instructions with one list per unique
address.

In the optimization phase instead of scanning through the basic block for mergeable
instructions, we now iterate over the lists generated by the pre-pass.

The decision to re-optimize a block is now made per list, so if we fail to merge any
instructions with the same address, then we do not attempt to optimize them in
future passes over the block.  This will help to reduce the time this pass
spends re-optimizing instructions.

In one pathological test case, this change reduces the time spent in the
SILoadStoreOptimizer from 0.2s to 0.03s.

This restructuring will also make it possible to implement further solutions in
this pass, because we can now add less expensive checks to the pre-pass and
filter instructions out early which will avoid the need to do the expensive
scanning during the optimization pass. For example, checking for adjacent
offsets is an inexpensive test we can move to the pre-pass.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D65961

Files:
  llvm/lib/Target/AMDGPU/SILoadStoreOptimizer.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D65961.214187.patch
Type: text/x-patch
Size: 14725 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190808/aef8f233/attachment.bin>


More information about the llvm-commits mailing list