[PATCH] D60944: [LSR] Limit the recursion for setup cost

Dave Green via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Apr 21 02:10:00 PDT 2019


dmgreen created this revision.
dmgreen added reviewers: samparker, reames.
Herald added subscribers: javed.absar, hiraditya.
Herald added a project: LLVM.

In some circumstances we can end up with setup costs that are very complex to compute, even though the scevs are not very complex to create. This can also lead to setupcosts that are calculated to be exactly -1, which LSR treats as an invalid cost. This patch puts a limit on the recursion depth for setup cost to prevent them taking too long.

Thanks to @reames for the report and test case.


https://reviews.llvm.org/D60944

Files:
  llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
  llvm/test/CodeGen/Hexagon/swp-carried-1.ll
  llvm/test/Transforms/LoopStrengthReduce/gnarly-setupcost.ll
  llvm/test/Transforms/LoopStrengthReduce/two-combinations-bug.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D60944.195987.patch
Type: text/x-patch
Size: 6367 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190421/5e9ef2a2/attachment.bin>


More information about the llvm-commits mailing list