[PATCH] D87832: [IndVars] Remove checks basing on iteration count

Max Kazantsev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 17 07:51:41 PDT 2020


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

This patch removes monotonic checks against IndVar if we can prove them
to be true on first & last iteration and no overflow happening between.

It seems that `optimizeLoopExits` is the right place for it: it will allow us to
compute symbolic max iteration count once. Unfortunately, if comparison
doesn't get eliminated, it can be turned into an unsigned comparison. And
SCEV have big troubles proving even relatively simple things for unsigned.

This code should be moved when this problem is resolved.


https://reviews.llvm.org/D87832

Files:
  llvm/lib/Transforms/Utils/SimplifyIndVar.cpp
  llvm/test/Transforms/IndVarSimplify/monotonic_checks.ll
  llvm/test/Transforms/IndVarSimplify/predicated_ranges.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D87832.292502.patch
Type: text/x-patch
Size: 7747 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200917/add67633/attachment.bin>


More information about the llvm-commits mailing list