[PATCH] D80273: [LSR] Filter for postinc formulae

Dave Green via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 19 23:57:45 PDT 2020


dmgreen created this revision.
dmgreen added reviewers: qcolombet, bcahoon, sgundapa, samparker, gilr.
Herald added a subscriber: hiraditya.
Herald added a project: LLVM.

In more complicated loops we can easily hit the complexity limits of loop strength reduction. If we do and filtering occurs, it's all too easy to remove the wrong formulae for post-inc preferring accesses due to it attempting to maximise register re-use. The patch adds an alternative filtering step when the target is preferring postinc to pick postinc formulae instead, hopefully lowering the complexity to below the limit so that aggressive filtering is not needed.

There is also a change in here to stop considering existing addrecs as free under postinc. We should already be modelling them as a reg so don't want it to cause us to get the cost wrong. (I'm not sure that code makes sense in general, but there are X86 tests specifically for it where it seems to be helping so have left it around for the standard non-post-inc case).


https://reviews.llvm.org/D80273

Files:
  llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
  llvm/test/CodeGen/Thumb2/mve-float16regloops.ll
  llvm/test/CodeGen/Thumb2/mve-float32regloops.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D80273.264956.patch
Type: text/x-patch
Size: 21618 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200520/5b575fa2/attachment.bin>


More information about the llvm-commits mailing list