[PATCH] D58435: [SCEV] Ensure that isHighCostExpansion takes into account what is being divided

Dave Green via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 20 03:31:07 PST 2019


dmgreen created this revision.
dmgreen added reviewers: sanjoy, wmi, lebedev.ri, mkazantsev.
Herald added subscribers: jdoerfert, javed.absar.

A SCEV is not low-cost just because you can divide it by a power of 2. We need to also
check what we are dividing to make sure it too is not a high-code expansion. This helps
to not expand the exit value of certain loops, helping not to bloat the code.

The change in no-iv-rewrite.ll is reverting to back before rL194116 <https://reviews.llvm.org/rL194116>, and looks a lot like
the other tests in replace-loop-exit-folds.ll.


https://reviews.llvm.org/D58435

Files:
  lib/Analysis/ScalarEvolutionExpander.cpp
  test/Transforms/IndVarSimplify/no-iv-rewrite.ll
  test/Transforms/IndVarSimplify/replace-loop-exit-folds.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D58435.187538.patch
Type: text/x-patch
Size: 8276 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190220/a37c6a71/attachment.bin>


More information about the llvm-commits mailing list