[PATCH] D144014: [LSR] Improve filtered uses in NarrowSearchSpaceByPickingWinnerRegs

Dave Green via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 14 07:28:25 PST 2023


dmgreen created this revision.
dmgreen added reviewers: chill, fhahn, samtebbs, aemerson.
Herald added subscribers: StephenFan, hiraditya.
Herald added a project: All.
dmgreen requested review of this revision.
Herald added a project: LLVM.

NarrowSearchSpaceByPickingWinnerRegs has an aggressive filtering method to reduce the complexity of the search space down by picking a best formula with the highest number of reuses and assuming it will yield profitable reuse. In certain cases we can find a "best" formula like `{X+30,+,1}` and later check a formula like `{X,+,1}` with the same number of Uses. On certain architectures it can be better to pick `{X,+,1}`, especially if an offset of 30 can be used as a legal addressing mode, but -30 cannot. That happens under Thumb1 code, which has fairly limited addressing modes. This patch adds a check to see if it can pick the simpler formula, if it looks more profitable.


https://reviews.llvm.org/D144014

Files:
  llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
  llvm/test/CodeGen/Thumb/arm_q15_to_q31.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D144014.497314.patch
Type: text/x-patch
Size: 10892 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230214/d2e76d5f/attachment.bin>


More information about the llvm-commits mailing list