[all-commits] [llvm/llvm-project] 34f682: [SCEV] Expose and use maximum constant exit counts...

Philip Reames via All-commits all-commits at lists.llvm.org
Thu Oct 24 19:10:30 PDT 2019


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 34f68253ca3dbe4ab5ef138629bdd63e06901efc
      https://github.com/llvm/llvm-project/commit/34f68253ca3dbe4ab5ef138629bdd63e06901efc
  Author: Philip Reames <listmail at philipreames.com>
  Date:   2019-10-24 (Thu, 24 Oct 2019)

  Changed paths:
    M llvm/include/llvm/Analysis/ScalarEvolution.h
    M llvm/lib/Analysis/ScalarEvolution.cpp
    M llvm/lib/Transforms/Scalar/IndVarSimplify.cpp

  Log Message:
  -----------
  [SCEV] Expose and use maximum constant exit counts for individual loop exits

We were already going to all of the trouble of computing maximum constant exit counts for each loop exit, we might as well expose them through the API.  The change in IndVars is mostly to demonstrate that the wired up code works, but it als very slightly strengthens the transform.  The strengthened case is rather narrow though: it requires one exactly analyzeable exit, one imprecisely analyzeable exit (with the upper bound less than the precise one), and one unanalyzeable exit.  I coudn't construct a reasonably stable test case.

This does increase the memory usage of the BackedgeTakenCount by a factor of 2 in the worst case.

I also noticed the loop in IndVars is O(#Exits ^ 2).  This doesn't change with this patch.  A future patch will cache this result inside of SCEV to avoid requering.




More information about the All-commits mailing list