[PATCH] D89381: [SCEV] Use nw flag and symbolic iteration count to sharpen ranges of AddRecs

Max Kazantsev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 14 04:05:57 PDT 2020


mkazantsev created this revision.
mkazantsev added reviewers: lebedev.ri, fhahn, reames, skatkov.
Herald added subscribers: llvm-commits, hiraditya.
Herald added a project: LLVM.
mkazantsev requested review of this revision.

We can sharpen the range of a AddRec if we know that it does not
self-wrap and know the symbolic iteration count in the loop. If we can
evaluate the value of AddRec on the last iteration and prove that at least
one its intermediate value lies between start and end, then no-wrap flag
allows us to conclude that all of them also lie between start and end. So
the estimate of range can be improved to union of ranges of start and end.


https://reviews.llvm.org/D89381

Files:
  llvm/include/llvm/Analysis/ScalarEvolution.h
  llvm/lib/Analysis/ScalarEvolution.cpp
  llvm/test/Analysis/ScalarEvolution/no-wrap-symbolic-becount.ll
  llvm/test/Transforms/IndVarSimplify/X86/eliminate-trunc.ll
  llvm/test/Transforms/IndVarSimplify/promote-iv-to-eliminate-casts.ll
  llvm/test/Transforms/IndVarSimplify/widen-loop-comp.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D89381.298101.patch
Type: text/x-patch
Size: 11971 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201014/13ccb102/attachment.bin>


More information about the llvm-commits mailing list