[PATCH] D46046: [SCEV] Do not use induction in isKnownPredicate for simplification umax

Serguei Katkov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 25 01:23:55 PDT 2018


skatkov created this revision.
skatkov added reviewers: sanjoy, mkazantsev.
Herald added a subscriber: javed.absar.

During simplification umax we trigger isKnownPredicate twice. As a first attempt it
tries the induction. To do that it tries to get post increment of SCEV.
Re-writing the SCEV may result in simplification of umax. If the SCEV contains a lot
of umax operations this recursion becomes very slow.

The added test demonstrates the slow behavior.

To resolve this we use only simple ways to check whether the predicate is known.


https://reviews.llvm.org/D46046

Files:
  include/llvm/Analysis/ScalarEvolution.h
  lib/Analysis/ScalarEvolution.cpp
  test/Analysis/IVUsers/deep_recursion_in_scev.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D46046.143869.patch
Type: text/x-patch
Size: 11238 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180425/6f21d014/attachment.bin>


More information about the llvm-commits mailing list